| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Origin: Ivan Godard <[email protected]> |
| 4 |
// Wolfgang Bangerth <[email protected]> |
| 5 |
|
| 6 |
// PR c++/17344: Substitution failure is not an error |
| 7 |
// for default template argument |
| 8 |
|
| 9 |
template <class> struct intTraits; |
| 10 |
|
| 11 |
template<> struct intTraits<int> { |
| 12 |
static const int i = 0; |
| 13 |
}; |
| 14 |
|
| 15 |
template<typename E, E i = intTraits<E>::i> struct A {}; |
| 16 |
|
| 17 |
struct S { |
| 18 |
template <template <typename> class X> S(X<void>); |
| 19 |
}; |
| 20 |
|
| 21 |
int bar(S); |
| 22 |
int bar(A<int,0>); |
| 23 |
|
| 24 |
A<int> bed; |
| 25 |
int i = bar(bed); |