This code snippet:
class X
{
~X() {}
void f ()
{
X::~X ();
}
};
violates clause 12.4 ; 12 (explicit destructor calls must use a member
access operator) . However, the diagnostic given is somewhat confusing:
dstr.c: In member function void X::f():
dstr.c:6: error: no matching function for call to X::~X()
dstr.c:3: note: candidates are: X::~X()
--
Summary: obscure error for attempt to use destructor declarator
syntax for destructor call
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: amylaar at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29065