[Bug c++/14339] New: Bogus extra error message after redefinition of member function

olly at survex dot com gcc-bugzilla@gcc.gnu.org
Sun Feb 29 01:56:00 GMT 2004


$ cat gccbug.cc 
class A {
    public:
    A() {}
    int foo(int);
};

int A::foo(int x) { return x; }
int A::foo(int x) { return x + 1; }
$ g++ -c gccbug.cc
gccbug.cc:8: error: redefinition of `int A::foo(int)'
gccbug.cc:7: error: `int A::foo(int)' previously defined here
gccbug.cc:8: error: no `int A::foo(int)' member function declared in class `A'
$

The last error line is bogus as that method *is* declared in class A.  This
extra error message is largely cosmetic, though perhaps it might confuse some
people.

This error also occurs with GCC 3.2.3, but not with 2.95, so technically it's
a regression...

-- 
           Summary: Bogus extra error message after redefinition of member
                    function
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: olly at survex dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14339



More information about the Gcc-bugs mailing list