| 1 |
// PR c++/114901 |
| 2 |
// { dg-do compile { target c++20 } } |
| 3 |
|
| 4 |
template <class D> |
| 5 |
constexpr bool C = sizeof(D); |
| 6 |
|
| 7 |
template <typename U> |
| 8 |
struct T { |
| 9 |
template<typename V, typename N> |
| 10 |
struct Foo { |
| 11 |
Foo(V, N); |
| 12 |
}; |
| 13 |
|
| 14 |
template<typename X, typename N> |
| 15 |
requires (C<N>) // removes the require-clause will make the crash disappear |
| 16 |
Foo(X, N) -> Foo<X, N>; |
| 17 |
|
| 18 |
template <typename Y, typename Y2, int N = sizeof(Y2)> |
| 19 |
using AFoo = Foo<decltype(N), Y2>; |
| 20 |
}; |
| 21 |
|
| 22 |
T<double>::AFoo s{1, 2}; // { dg-error "deduction|no match" } |