This is the mail archive of the gcc-patches@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: Operator name lookup


Mark Mitchell <mark@codesourcery.com> writes:

| G++ presently accepts this code:
| 
|   typedef int B;
|   struct A
|   {
|     int B;
|     operator B *();
|   };
| 
| EDG and the new parser agree -- this is invalid.  (In particular, the
| "B" in "operator B*" refers to "A::B", not "::B".)
| 
| I do not find anything in the standard that justifies G++'s present
| interpretation.

G++'s current behaviour is bogus -- as is usual when it comes to name
lookup :-(.  Ordinary name lookup finds A::B and stops.

[...]

| Therefore, I will not try to add support for this
| extension to the new parser, and I will add an appropriate NEWS entry.
| 
| Comments?

I'm not convinced that was a feature :-) :-)  Please just ditch it.

-- Gaby


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