c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / template / typename25.C
blob04e48e1172461887c20e18927b49575f06c1f860
1 // PR c++/107773
2 // Verify lookup for TYPENAME_TYPE appearing to the left of the ::
3 // scope resolution operator correctly ignores non-types.
5 struct a {
6   typedef void type;
7 };
9 struct c {
10   struct b : a {
11     typedef b self;
12     static int m;
13   };
14   int b;
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;
25 template void f<c>();
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;
33 template struct d<c>;