The diagnostic for the following invalid code snippet got worse with
GCC 4.0.0:

=============================================
struct A {};

A::operator int();
=============================================

We now issue a duplicate message and some more bogus stuff:

  bug.cc:3: error: no 'A::operator int()' member function declared in class 'A'
  bug.cc:3: error: no 'A::operator int()' member function declared in class 'A'
  bug.cc:3: error: 'A::operator int()' cannot be overloaded
  bug.cc:3: error: with 'A::operator int()'
  bug.cc:3: error: declaration of 'A::operator int()' outside of class is not
definition

We used to issue the following message which looks OK to me:

  bug.cc:3: error: no `A::operator int()' member function declared in class `A'
  bug.cc:3: error: declaration of `A::operator int()' outside of class is not
definition

For a normal member function like "void A::foo()" the error message is OK.


-- 
           Summary: [4.0/4.1/4.2 regression] Bogus cruft in error message
                    for invalid operator declaration
           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=25635


Reply via email to