OSDN Git Service

Restore canonical type comparison for dependent type(def)s
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / typedef26.C
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin: PR c++/42225
3 // { dg-do compile }
4
5 struct A
6 {
7     typedef int TI;
8 };
9
10 template<class T0>
11 struct S0
12 {
13     int i;
14 };
15
16 template<class _T, int>
17 struct S1
18 {
19     typedef _T T;
20     typedef typename T::TI TTI;
21     typedef S0<TTI> TT0;
22     typedef S0<typename T::TI> TT1;
23 };
24
25 template<class T>
26 void
27 foo(const T&)
28 {
29     typedef typename T::TI TTI;
30     typedef S0<TTI> TT1;
31     typedef S0<typename T::TI> TT2;
32 }
33
34 int
35 main()
36 {
37     A a;
38     foo (a);
39 }
40