gcc/testsuite/g++.dg/cpp1z/nontype-auto17.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | template <int> struct K { }; |
| 4 | |
| 5 | template <class T = void, typename T::type M> int f(K<M>); // { dg-error "void" } |
| 6 | int a = f(K<42>{}); // { dg-error "no match" } |
| 7 | |
| 8 | struct S { using type = void; }; |
| 9 | template <class T = S, typename T::type M> int g(K<M>); // { dg-message "deduction" } |
| 10 | int b = g(K<42>{}); // { dg-error "no match" } |