Looking at PR 21799, I noticed that we accept the code if we remove the second template function, like so: template <class T> void f (T &, void (T::*)() ); struct X { void g() const; }; const X *x; int main () { f (*x, &X::g); }
-- Summary: Accepts invalid for const member pointer functions Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21801