This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8891: Unexplicit error message about naming conflict
- From: benoit dot sibaud at rd dot francetelecom dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 10 Dec 2002 14:33:13 -0000
- Subject: c++/8891: Unexplicit error message about naming conflict
- Reply-to: benoit dot sibaud at rd dot francetelecom dot com
>Number: 8891
>Category: c++
>Synopsis: Unexplicit error message about naming conflict
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Dec 10 06:36:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Benoît Sibaud
>Release: gcc-3.2.1
>Organization:
>Environment:
Debian Sarge i686-pc-linux-gnu
>Description:
class Foo
{
protected:
enum {BadName, A, B, C};
};
class BadName : public Foo
{
};
class Toto : public Foo
{
public:
Foo* fct() { return new BadName; }
};
$ g++ -Wall foo.cpp
foo.cpp: In member function `Foo* Toto::fct()':
foo.cpp:18: parse error before `;' token
foo.cpp:18: warning: no return statement in function returning non-void
Conflict between ::BadName and BadName in Foo enum. The error message is not really helpful (the enum was deeply hidden in a class hierarchy in my case).
Tested with several 2.95.2, 3.0.x, 3.1.x and 3.2.x versions.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: