This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/8891: Unexplicit error message about naming conflict


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]