// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s template requires (sizeof(T) >= 4) // expected-note@-1{{similar constraint expressions not considered equivalen}} class A{}; // expected-note{{template is declared here}} template requires (sizeof(T) >= 4 && sizeof(T) <= 10) // expected-note@-1{{similar constraint expression here}} class A{}; // expected-error{{class template partial specialization is not more specialized than the primary template}} template concept C1 = sizeof(T) >= 4; template requires C1 class B{}; template requires (C1 && sizeof(T) <= 10) class B{}; template concept C2 = sizeof(T) > 1 && sizeof(T) <= 8; template class C{}; template requires C1 class C{}; template class D{}; // expected-note{{previous definition is here}} template class D{}; // expected-error{{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}} expected-error{{redefinition of 'D'}} template requires C1 // expected-note{{previous template declaration is here}} class E{}; template // expected-error{{requires clause differs in template redeclaration}} class E{}; // expected-error{{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}} template struct F{ enum{ value = 1 }; }; template requires C1 && C2 struct F{ enum{ value = 2 }; }; template requires C1 || C2 struct F{ enum{ value = 3 }; }; static_assert(F::value == 2); static_assert(F::value == 3); static_assert(F::value == 1); // Make sure atomic constraints subsume each other only if their parameter // mappings are identical. template requires C2 struct I { }; // expected-note {{template is declared here}} template requires C2 struct I { }; // expected-error {{class template partial specialization is not more specialized than the primary template}} template requires C2 && C2 struct I { };