1 // P0634R3
2 // { dg-do compile { target c++2a } }
3 
4 struct X {
5   template<typename T>
6   struct N { };
7 };
8 
9 template <typename T>
10 struct Y {
11   template<typename U>
12   struct N { };
13 };
14 
15 template <typename T>
16 struct A
17 {
18   template <typename U>
19   struct N { };
20 
21   typedef typename A::template N<int> a1;
22   typedef typename A::template N<T> a2;
23   typename A::template N<int> a3;
24   typename A::template N<T> a4;
25   A::template N<int> a9;
26   A::template N<T> a10;
27   typedef A<T>::template N<int> a13;
28   typedef A<T>::template N<T> a14;
29 
30   typedef typename X::template N<int> x1;
31   typedef typename X::template N<T> x2;
32   typename X::template N<int> x3;
33   typename X::template N<T> x4;
34   typedef X::N<int> x5;
35   typedef X::N<T> x6;
36   typedef typename X::N<int> x7;
37   typedef typename X::N<T> x8;
38   X::N<int> x9;
39   X::N<T> x10;
40   typename X::N<int> x11;
41   typename X::N<T> x12;
42 
43   typedef typename Y<int>::template N<int> y1;
44   typedef typename Y<int>::template N<T> y2;
45   typedef typename Y<T>::template N<int> y3;
46   typedef typename Y<T>::template N<T> y4;
47   typename Y<int>::template N<int> y5;
48   typename Y<int>::template N<T> y6;
49   typename Y<T>::template N<int> y7;
50   typename Y<T>::template N<T> y8;
51   typedef Y<int>::N<int> y9;
52   typedef Y<int>::N<T> y10;
53   typedef Y<T>::template N<int> y11;
54   typedef Y<T>::template N<T> y12;
55   typedef typename Y<int>::N<int> y13;
56   typedef typename Y<int>::N<T> y14;
57   Y<int>::N<int> y17;
58   Y<int>::N<T> y18;
59   typename Y<int>::N<int> y21;
60   typename Y<int>::N<T> y22;
61   typedef Y<int>::N<int> y25;
62   typedef Y<int>::N<T> y26;
63   typedef Y<T>::template N<int> y27;
64   typedef Y<T>::template N<T> y28;
65 };
66