| 1 |
// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify |
| 2 |
|
| 3 |
template<typename T, int a> |
| 4 |
concept C1 = true; |
| 5 |
|
| 6 |
template<C1 T> |
| 7 |
// expected-error@-1 {{'C1' requires more than 1 template argument; provide the remaining arguments explicitly to use it here}} |
| 8 |
using badA = T[10]; |
| 9 |
|
| 10 |
template<C1<0> T> |
| 11 |
using A = T[10]; |
| 12 |
|
| 13 |
using a = A<int>; |
| 14 |
|
| 15 |
namespace ns { |
| 16 |
template<typename T, typename U, typename... X> |
| 17 |
concept C2 = true; |
| 18 |
} |
| 19 |
|
| 20 |
template<ns::C2 T1, ::ns::C2 T2> |
| 21 |
// expected-error@-1 2{{'C2' requires more than 1 template argument; provide the remaining arguments explicitly to use it here}} |
| 22 |
requires (sizeof(T1) <= sizeof(T2)) |
| 23 |
struct badB { }; |
| 24 |
|
| 25 |
template<ns::C2<int> T1, ::ns::C2<char, T1> T2> |
| 26 |
requires (sizeof(T1) <= sizeof(T2)) |
| 27 |
struct B { }; |
| 28 |
|
| 29 |
using b = B<int, int>; |
| 30 |
|
| 31 |
template<ns::C2... T1> |
| 32 |
// expected-error@-1 {{'C2' requires more than 1 template argument; provide the remaining arguments explicitly to use it here}} |
| 33 |
struct badC { }; |
| 34 |
|
| 35 |
template<ns::C2<int>... T1> |
| 36 |
struct C { }; |
| 37 |
|
| 38 |
using c1 = C<char, char, char>; |
| 39 |
using c2 = C<char, char, char, char>; |