1 // RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
8 template<C1 T
, C1 U
= int>
14 template<typename T
, int a
= 0>
18 template<ns::C2 T1
, ::type::ns::C2 T2
> requires (sizeof(T1
) <= sizeof(T2
))
21 using b
= B
<int, int>;
23 template<ns::C2
... T1
>
26 using c1
= C
<char, char, char>;
27 using c2
= C
<char, char, char, char>;
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}}
44 struct test1
{ }; // expected-note{{template is declared here}}
46 template<template<typename
> typename T
>
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}}
62 // Don't destroy annotation 'C' at the end of the lambda; else we'll run into a
63 // use-after-free bug while constructing the type constraint 'C' on 'Default'.
64 template <typename Ret
, C Default
= decltype([] { return Ret(); })>
67 template <typename Ret
, C Default
= S
<[] { return Ret(); }>>