blob: 4f04cb3f43b1f5fd2a332229448134bf53e27655 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// PR c++/100138
// { dg-do compile { target c++20 } }
template <class T>
struct A {
A(T, auto... xs) requires (sizeof...(xs) != 0);
};
constexpr bool f(...) { return true; }
template <class T>
struct B {
B(T, auto... xs) requires (f(xs...)); // { dg-error "constant expression" }
};
template <class T>
struct C {
C(T, auto x) requires (f(x)); // { dg-error "constant expression" }
};
int main() {
A x{1, 2}; // { dg-bogus "" }
B y{1, 2}; // { dg-error "deduction|no match" }
C z{1, 2}; // { dg-error "deduction|no match" }
}
|