[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / cxx2a-constrained-template-param-with-partial-id.cpp
blob0afe1e6f2b6e5af288df372c5294c267bfd0f383
1 // RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
3 template<typename T, int a>
4 concept C1 = true;
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];
10 template<C1<0> T>
11 using A = T[10];
13 using a = A<int>;
15 namespace ns {
16 template<typename T, typename U, typename... X>
17 concept C2 = true;
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 { };
25 template<ns::C2<int> T1, ::ns::C2<char, T1> T2>
26 requires (sizeof(T1) <= sizeof(T2))
27 struct B { };
29 using b = B<int, int>;
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 { };
35 template<ns::C2<int>... T1>
36 struct C { };
38 using c1 = C<char, char, char>;
39 using c2 = C<char, char, char, char>;