[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / template / typedef27.C
blobe50f17ccd3ba87d7fb2387523a2b985293a217a0
1 // Origin: PR c++/42713
2 // { dg-do compile }
4 template<class T>
5 struct S
7 };
9 template<class T>
10 struct S0
12     typedef T TT;
15 template<class U, class V>
16 struct super_struct : S0<V>
18     typedef S0<V> super;
21 template<class U, class V, class W>
22 struct S1 : super_struct<U, V>
24     typedef super_struct<U, V> super;
25     typedef typename super::super Super2;
26     typedef typename Super2::TT Super2TT;
27     void
28     foo()
29     {
30         S<Super2TT> s1;
31     }
34 template<class U, class V>
35 struct S2 : super_struct<U, V>
37     typedef super_struct<U, V> super;
38     typedef typename super::super Super2;
39     typedef typename Super2::TT Super2TT;
40     void
41     foo()
42     {
43         S<Super2TT> s1;
44     }
47 int
48 main()
50     S1<int, S<int>, int> s1;
51     s1.foo();
52     S2<int, S<int> > s2;
53     s2.foo();