This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14339] New: Bogus extra error message after redefinition of member function
- From: "olly at survex dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Feb 2004 01:56:44 -0000
- Subject: [Bug c++/14339] New: Bogus extra error message after redefinition of member function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ 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