| 1 |
// DR 2032 - Default template-arguments of variable templates |
| 2 |
// PR c++/96218 |
| 3 |
// { dg-do compile { target c++14 } } |
| 4 |
|
| 5 |
// [temp.param]/14: If a template-parameter of a class template, variable |
| 6 |
// template, or alias template has a default template-argument, each subsequent |
| 7 |
// template-parameter shall either have a default template-argument supplied or |
| 8 |
// be a template parameter pack. |
| 9 |
template<typename T = int, typename U> |
| 10 |
T vt; // { dg-error "no default argument" } |
| 11 |
|
| 12 |
// [temp.param]/14: If a template-parameter of a primary class template, |
| 13 |
// primary variable template, or alias template is a template parameter pack, |
| 14 |
// it shall be the last template-parameter. |
| 15 |
template<typename... Ts, typename U> // { dg-error "must be at the end" } |
| 16 |
int vt2; |