Topic: Defect Report: Ambiguous member sub-object reference not handled


Author: "Johannes Schaub (litb)" <schaub-johannes@web.de>
Date: Sun, 18 Oct 2009 15:34:54 CST
Raw View
As part of solving defect report #39, name lookup in 10.2[class-
member.lookup] was changed, but it seems to have missed to handle the
following case

struct A { int a; };
struct B : A { };
struct C : A { };
struct D : B, C { };
int main() { &D::a; }

I believe that the problem can be solved by adding a similar paragraph to
5.3.1[expr.unary.op] that was also added to 5.2.5[expr.ref]/5:

For a qualified-id, if the member is a non-static data member or a non-
static member function, the program is ill-formed if the class of which it
is directly a member is an ambiguous base (10.2) of the naming class (11.2)
of the qualified-id.

And refer to it by the note in 10.2[class.member.lookup]/13

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]