Debian Codegraph @

gcc/testsuite/g++.dg/template/non-dependent34.C

raw
1 // Verify we diagnose failed qualified lookup into the current
2 // instantiation ahead of time.
3
4 namespace without_dependent_base {
5 template<class T>
6 struct A {
7 void f(A& other) {
8 A::x; // { dg-error "'x' is not a member" }
9 this->x; // { dg-error "no member named 'x'" }
10 other.y; // { dg-error "no member named 'y'" }
11 typename A::type z; // { dg-error "does not name a type" }
12
13 struct B {
14 void g(A& other) {
15 A::x; // { dg-error "'x' is not a member" }
16 this->x; // { dg-error "no member named 'x'" }
17 other.y; // { dg-error "no member named 'y'" }
18 typename A::type z; // { dg-error "does not name a type" }
19 }
20 };
21 }
22 };
23 }
24
25 namespace with_dependent_base {
26 template<class T>
27 struct A : T {
28 void f(A& other) {
29 A::x;
30 this->x;
31 other.y;
32 typename A::type z;
33
34 struct B : T {
35 void g(A& other) {
36 A::x;
37 this->x;
38 other.y;
39 typename A::type z;
40 }
41 };
42 }
43 };
44 }