This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/8891: Unexplicit error message about naming conflict
- From: bangerth at dealii dot org
- To: benoit dot sibaud at rd dot francetelecom dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org
- Date: 10 Dec 2002 14:55:10 -0000
- Subject: Re: c++/8891: Unexplicit error message about naming conflict
- Reply-to: bangerth at dealii dot org, benoit dot sibaud at rd dot francetelecom dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: Unexplicit error message about naming conflict
State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Tue Dec 10 06:55:08 2002
State-Changed-Why:
I don't know what to do with this report, since the message
is probably the best you can get. In any case, there is
no _naming conflict_: declaring an enum member and a
class with the same name is just fine, it's only when you
access that you have to make clear what you want: by
default, lookup happens _within_ the class, so you get
the enum name, which of course does not go well with the
"operator new". If you want the class name, you have to
specify that:
Foo* fct() { return new ::BadName; }
This compiles just fine.
So what you request is that upon seeing the bogus
new enum-value;
line, the compiler looks up whether somewhere, outside of
its usual search area, there is class name with the same
name as that enum value. I think this is asking for too
much.
Maybe someone of the C++ front end guys can comment on what
we should do with this request.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8891