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

Reply via email to