diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/lookup18.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/lookup18.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/lookup18.C b/gcc/testsuite/g++.old-deja/g++.other/lookup18.C new file mode 100644 index 000000000..71124a2f0 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/lookup18.C @@ -0,0 +1,23 @@ +// { dg-do assemble } +// Test that referring to an ambiguous base in name lookup prevents +// access to the field, even though the field is not ambiguous. + + +struct A { + int i; +}; +struct B: virtual A { }; +struct C: public B { }; +struct D: public B { }; +struct E: public C, public D { + void f (); +}; + +void E::f() { + B::i = 0; // { dg-error "" } B is ambiguous +} + +void f () { + E e; + e.B::i = 0; // { dg-error "" } B is ambiguous +} |