Debian Codegraph @

gcc/testsuite/g++.dg/template/typename25.C

raw
1 // PR c++/107773
2 // Verify lookup for TYPENAME_TYPE appearing to the left of the ::
3 // scope resolution operator correctly ignores non-types.
4
5 struct a {
6 typedef void type;
7 };
8
9 struct c {
10 struct b : a {
11 typedef b self;
12 static int m;
13 };
14 int b;
15 };
16
17 template<class T>
18 void f() {
19 // A TYPENAME_TYPE whose TYPE_CONTEXT is a nested TYPENAME_TYPE.
20 typedef typename T::b::type type;
21 // A SCOPE_REF whose first operand is a TYPENAME_TYPE.
22 int m = T::b::m;
23 }
24
25 template void f<c>();
26
27 template<class T>
28 struct d : T::b::self {
29 // A USING_DECL whose USING_DECL_SCOPE is a TYPENAME_TYPE.
30 using typename T::b::type;
31 };
32
33 template struct d<c>;