PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / typedef25.C
blobf5a13ea85956c98b71fc7c0be1f67bf0206a45f6
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin PR c++/42225
3 // { dg-do compile { target c++11 } }
5 template<class T>
6 struct A
8     typedef T I;
9     static const char *i;
12 template<class T, int>
13 struct B
15     typedef T TT;
16     typedef decltype(TT::i)  TT_I0;
17     typedef decltype(&TT::i) TT_I1;
18     typedef decltype(*TT::i) TT_I2;
19     typedef A<TT_I0> TA0;
20     typedef A<TT_I1> TA1;
21     typedef A<TT_I2> TA2;
24 template<class T>
25 void
26 foo()
28     typedef T TT;
29     typedef decltype(TT::i)  TT_I0;
30     typedef decltype(&TT::i) TT_I1;
31     typedef decltype(*TT::i) TT_I2;
32     typedef A<TT_I0> TA0;
33     typedef A<TT_I1> TA1;
34     typedef A<TT_I2> TA2;
37 int
38 main()
40     foo<A<int> >();