This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56359] New: [4.8 regression] Bogus "error: no matching function for call to ..."
- From: "ppluzhnikov at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 17 Feb 2013 01:18:48 +0000
- Subject: [Bug c++/56359] New: [4.8 regression] Bogus "error: no matching function for call to ..."
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: ppluzhnikov@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);
^