OSDN Git Service

* g++.old-deja/g++.other/eh4.C: Fix typo.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / lookup18.C
1 // Test that referring to an ambiguous base in name lookup prevents
2 // access to the field, even though the field is not ambiguous.
3
4 // Build don't link:
5
6 struct A {
7   int i;
8 };
9 struct B: virtual A { };
10 struct C: public B { };
11 struct D: public B { };
12 struct E: public C, public D {
13   void f ();
14 };
15
16 void E::f() {
17   B::i = 0;                     // ERROR - B is ambiguous
18 }
19
20 void f () {
21   E e;
22   e.B::i = 0;                   // ERROR - B is ambiguous
23 }