This is a spin-off for the diagnostic issue from PR 25638: ========================================= struct A { ~A(); };
struct B { template<int> friend A::~A(); }; ========================================= For the above code we get the error message: bug.cc:5: error: prototype for 'A::~A()' does not match any in class 'A' bug.cc:1: error: candidate is: A::~A() The error message could be better: 1) A destructor can never be a template. This is not mentioned yet. 2) We only print 'A::~A()' as the prototype. We should probably print that we have a template here. Otherwise there's no difference to the rejected candidate. -- Summary: Bad diagnostic for templated destructor as friend Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: diagnostic, monitored Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: reichelt at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25666