[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Parser / cxx2a-constrained-template-param.cpp
blob6f14b66419c4981a997a85b31493621fcd0f0128
1 // RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
3 namespace type
5 template<typename T>
6 concept C1 = true;
8 template<C1 T, C1 U = int>
9 using A = T[10];
11 using a = A<int>;
13 namespace ns {
14 template<typename T, int a = 0>
15 concept C2 = true;
18 template<ns::C2 T1, ::type::ns::C2 T2> requires (sizeof(T1) <= sizeof(T2))
19 struct B { };
21 using b = B<int, int>;
23 template<ns::C2... T1>
24 struct C { };
26 using c1 = C<char, char, char>;
27 using c2 = C<char, char, char, char>;
30 namespace non_type
32 template<int v>
33 concept C1 = true;
35 template<C1 v, C1 u = 0> // expected-error{{expected a type}} // expected-note{{declared here}}
36 // expected-error@-1 2{{concept named in type constraint is not a type concept}}
37 // expected-error@-2 {{expected ',' or '>' in template-parameter-list}}
38 int A = v; // expected-error{{'v' does not refer to a value}}
41 namespace temp
43 template<typename>
44 struct test1 { }; // expected-note{{template is declared here}}
46 template<template<typename> typename T>
47 concept C1 = true;
49 template<C1 TT, C1 UU = test1> // expected-error{{use of class template 'test1' requires template arguments}}
50 // expected-error@-1 2{{concept named in type constraint is not a type concept}}
51 using A = TT<int>; // expected-error{{expected ';' after alias declaration}}