This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/19732] New: [4.0 regression] Invalid destructor declarations accepted
- 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: 31 Jan 2005 23:10:24 -0000
- Subject: [Bug c++/19732] New: [4.0 regression] Invalid destructor declarations accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following invalid code snippet is accepted by mainline:
==================================
struct A;
struct B { ~A(); };
==================================
Mark, this was caused by your patch
http://gcc.gnu.org/ml/gcc-cvs/2004-06/msg00888.html
This patch not only removed the error message
error ("destructor `%T' must match class name `%T'", name, rename);
for destructors from grokdeclarator, but also
error ("destructors must be member functions");
A testcase that used to trigger the second error message but is now accepted
is the following:
==================================
struct A;
void ~A();
==================================
--
Summary: [4.0 regression] Invalid destructor declarations
accepted
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: accepts-invalid, monitored
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19732