The following invalid code snippet is accepted since GCC 4.0.0:
================
struct A
{
~A A();
};
================
Even worse, the following code snippet is accepted, too:
================
struct B;
struct A
{
A::~B A();
};
================
Posting a patch soon.
--
Summary: [4.0/4.1/4.2] Destructor accepted as return-type of
constructor
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: accepts-invalid, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: reichelt at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28606