Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Defect Report: Ambiguous member sub-object reference not handled

4 views
Skip to first unread message

Johannes Schaub (litb)

unread,
Oct 18, 2009, 5:34:54 PM10/18/09
to
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...@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

0 new messages