This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25666] New: Bad diagnostic for templated destructor as friend
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2006 11:16:38 -0000
- Subject: [Bug c++/25666] New: Bad diagnostic for templated destructor as friend
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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