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: [email protected]
ReportedBy: [email protected]
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)