1 // RUN:  %clang_cc1 -std=c++2a -verify %s
2 
3 template<typename T, typename U>
4 constexpr bool is_same_v = false;
5 
6 template<typename T>
7 constexpr bool is_same_v<T, T> = true;
8 
9 template<typename T, typename U>
10 concept same_as = is_same_v<T, U>;
11 // expected-note@-1{{because 'is_same_v<int, _Bool>' evaluated to false}}
12 
13 template<typename T, typename... Us>
14 concept either = (is_same_v<T, Us> || ...);
15 
16 template<typename... Ts>
17 struct T {
18     template<same_as<Ts>... Us>
19     // expected-note@-1{{because 'same_as<int, _Bool>' evaluated to false}}
fooT20     static void foo(Us... u, int x) { };
21     // expected-note@-1{{candidate template ignored: deduced too few arguments}}
22     // expected-note@-2{{candidate template ignored: constraints not satisfied}}
23 
24     template<typename... Us>
25     struct S {
26         template<either<Ts, Us...>... Vs>
27         static void foo(Vs... v);
28     };
29 };
30 
main()31 int main() {
32   T<int, bool>::foo(1); // expected-error{{no matching function for call to 'foo'}}
33   T<int, bool>::foo(1, 2, 3); // expected-error{{no matching function for call to 'foo'}}
34   T<int, bool>::S<char>::foo(1, 'a');
35   T<int, bool>::S<char>::foo('a', true);
36 }
37