https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86652
--- Comment #1 from zhonghao at pku dot org.cn --- A related code sample: class C { public: template<typename i> int (*f())() const; }; int foo(C c) { return (*c.f<int>())(); } The messages from clang++: error: pointer to function type cannot have 'const' qualifier class C { public: template<typename i> int (*f())() const; }; error: no matching member function for call to 'f' int foo(C c) { return (*c.f<int>())(); } ~~^~~~~~ 2 errors generated.