summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/typedef26.C
blob: 7f4bc6b5ceaf1cb6dafd2ae77609750636f0cc6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/42225
// { dg-do compile }

struct A
{
    typedef int TI;
};

template<class T0>
struct S0
{
    int i;
};

template<class _T, int>
struct S1
{
    typedef _T T;
    typedef typename T::TI TTI;
    typedef S0<TTI> TT0;
    typedef S0<typename T::TI> TT1;
};

template<class T>
void
foo(const T&)
{
    typedef typename T::TI TTI;
    typedef S0<TTI> TT1;
    typedef S0<typename T::TI> TT2;
}

int
main()
{
    A a;
    foo (a);
}