1 // RUN: %clang_cc1 -std=c++2a -x c++ -verify %s
5 template <typename T
> requires (bool(T()))
7 template <typename U
> requires (bool(U()))
13 template <C1 T
> requires (bool(T()))
15 template <C1 U
> requires (bool(U()))
18 } // end namespace nodiag
22 template <typename T
> requires
true // expected-note{{previous template declaration is here}}
24 template <typename T
> struct A
; // expected-error{{requires clause differs in template redeclaration}}
26 template <typename T
> struct B
; // expected-note{{previous template declaration is here}}
27 template <typename T
> requires
true // expected-error{{requires clause differs in template redeclaration}}
30 template <typename T
> requires
true // expected-note{{previous template declaration is here}}
32 template <typename T
> requires (!0) // expected-error{{requires clause differs in template redeclaration}}
38 template <C1 T
> // expected-note{{previous template declaration is here}}
40 template <typename T
> requires C1
<T
> // expected-error{{type constraint differs in template redeclaration}}
43 } // end namespace diag
48 template <typename T
> requires (someFunc(T()))
52 template <typename U
> requires (someFunc(U()))
56 template <typename T
> requires (someFunc(T()))
60 } // end namespace nodiag
66 template <template <unsigned> class TT
> requires TT
<N
>::happy
// expected-note {{previous template declaration is here}}
69 template <template <unsigned> class TT
> requires TT
<N
>::happy
// expected-note {{previous template declaration is here}}
76 template <template <unsigned> class TT
> struct TA
<N
>::A
{ }; // expected-error{{requires clause differs in template redeclaration}}
80 template <template <unsigned> class TT
> requires TT
<N
+ 1>::happy
struct TA
<N
>::B
{ }; // expected-error{{requires clause differs in template redeclaration}}
84 // we do not expect a diagnostic here because the template parameter list is dependent.
85 template <template <unsigned> class TT
> requires TT
<N
+ 0>::happy
89 } // end namespace diag