http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56359
Bug #: 56359 Summary: [4.8 regression] Bogus "error: no matching function for call to ..." Classification: Unclassified Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: ppluzhni...@google.com Google ref b/8213841 Test case reduced from nodejs/src/node_io_watcher.cc typedef int (*InvocationCallback) (const int &); template < typename target_t > void SetPrototypeMethod (target_t, const char *, InvocationCallback); class A { void Initialize (); protected: static int Stop (const int &); void Stop (); // comment out to make the bug disappear. }; void A::Initialize () { SetPrototypeMethod (0, "stop", A::Stop); } Compiles fine with gcc-4.7, fails with SVN trunk @196104: g++ -c t.ii t.ii: In member function ‘void A::Initialize()’: t.ii:17:43: error: no matching function for call to ‘SetPrototypeMethod(int, const char [5], <unresolved overloaded function type>)’ SetPrototypeMethod (0, "stop", A::Stop); ^ t.ii:17:43: note: candidate is: t.ii:4:6: note: template<class target_t> void SetPrototypeMethod(target_t, const char*, InvocationCallback) void SetPrototypeMethod (target_t, const char *, InvocationCallback); ^ t.ii:4:6: note: template argument deduction/substitution failed: t.ii: In substitution of ‘template<class target_t> void SetPrototypeMethod(target_t, const char*, InvocationCallback) [with target_t = int]’: t.ii:17:43: required from here t.ii:10:16: error: ‘static int A::Stop(const int&)’ is protected static int Stop (const int &); ^ t.ii:17:43: error: within this context SetPrototypeMethod (0, "stop", A::Stop); ^