gcc/testsuite/g++.dg/template/explicit-args1.C
raw| 1 | // PR c++/34950 |
| 2 | |
| 3 | template <class T = int> struct policy { |
| 4 | typedef int unnecessary; |
| 5 | }; |
| 6 | |
| 7 | template <class Policy> struct A { |
| 8 | typedef int type; |
| 9 | typedef typename Policy::unnecessary unused; |
| 10 | }; |
| 11 | |
| 12 | template <class T> struct S { |
| 13 | typedef int type; |
| 14 | typedef typename A<T>::type unused; |
| 15 | }; |
| 16 | |
| 17 | template <class, class T> typename S<T>::type foo(); |
| 18 | template <class> S<policy<> >::type foo(); |
| 19 | |
| 20 | template <typename T> int def(T); |
| 21 | const int i = def(foo<int>); |