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]

Operator name lookup


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.

Unless I hear objections, I will consider this a bug in G++ (despite
the fact that g++.old-deja/g++.other/lookup19.C tests for this
behavior).  Therefore, I will not try to add support for this
extension to the new parser, and I will add an appropriate NEWS entry.

Comments?

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


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