[Bug c++/52766] New: unambiguous member lookup rejected

chrbr at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 29 09:19:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52766

             Bug #: 52766
           Summary: unambiguous member lookup rejected
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: chrbr@gcc.gnu.org


The following code (from 3.4.5-4 - class member access) is rejected:

struct A { int a; };

struct B: virtual A { };

struct C: B { };

struct D: B { };

struct E : public C, public D { };

void f()
{
  E e;
  e.B::a = 0;
}


f1.cxx: In function 'void f()':
f1.cxx:25:8: error: 'B' is an ambiguous base of 'E'

According to 10.2.5 (Member name lookup), member access e.B::a = 0 is OK
because there is only one "a" (virtual)



More information about the Gcc-bugs mailing list