152
|
1 // { dg-do compile { target c++2a } }
|
|
2
|
|
3 template<typename T>
|
|
4 inline constexpr bool foo_v = false;
|
|
5
|
|
6 template<typename T>
|
|
7 concept foo = (bool)(foo_v<T> | foo_v<T&>);
|
|
8
|
|
9 template<typename... Ts>
|
|
10 requires (foo<Ts> && ...)
|
|
11 void
|
|
12 bar() // { dg-message "with Ts = .int, char... evaluated to .false." }
|
|
13 { }
|
|
14
|
|
15 template<int>
|
|
16 struct S { };
|
|
17
|
|
18 template<int... Is>
|
|
19 requires (foo<S<Is>> && ...)
|
|
20 void
|
|
21 baz() // { dg-message "with Is = .2, 3, 4... evaluated to .false." }
|
|
22 { }
|
|
23
|
|
24 void
|
|
25 baz()
|
|
26 {
|
|
27 bar<int, char>(); // { dg-error "unsatisfied constraints" }
|
|
28 baz<2,3,4>(); // { dg-error "unsatisfied constraints" }
|
|
29 }
|