Debian Codegraph @

gcc/testsuite/g++.dg/lookup/scoped14.C

raw
1 // PR c++/112744
2 // { dg-do compile { target c++11 } }
3
4 struct A { int a = 0; };
5 struct B : A {};
6 struct C : A {};
7 struct D : B, C {};
8
9 int main()
10 {
11 D d;
12 (void) d.a; // { dg-error "request for member .a. is ambiguous" }
13 (void) d.A::a; // { dg-error ".A. is an ambiguous base of .D." }
14 }