[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / template / using17.C
blob1af1dc71e4e831446d43251ac81d4db5e6482a05
1 // PR c++/14258
2 // { dg-do run }
4 template<typename T>
5 struct A 
7   typedef T type;
8   typedef A type2;
9 };
10                                                                                
11 template<typename T>
12 struct B : A<T> 
14   using typename A<T>::type;
15   type t;
17   using typename A<T>::type2;
19   type f()
20   {
21     type i = 1;
22     return i;
23   }
26 int main()
28   B<int>::type t = 4;
29   if (t != 4)
30     __builtin_abort();
32   B<double> b;
33   b.t = 3;
34   if (b.t != 3)
35     __builtin_abort();
37   B<long> b2;
38   if (b2.f() != 1)
39     __builtin_abort();
41   B<double>::type2::type tt = 12;
42   if (tt != 12)
43     __builtin_abort();