// RUN: %clang_cc1 -std=c++26 %s -verify namespace hana_enable_if_idiom { template struct A {}; template> struct B; template struct B> {}; template struct B> {}; struct C { static const bool value = true; }; B b; } namespace GH132562 { struct I { int v = 0; }; namespace t1 { template struct A; template requires ((X.v == 0) ||...) struct A; } // namespace t1 namespace t2 { template struct A; // expected-note {{template is declared here}} template struct A; // expected-error@-1 {{is not more specialized than the primary template}} // expected-note@-2 {{no viable conversion from 'int' to 'I'}} template struct B; // expected-note {{template is declared here}} template struct B; // expected-error@-1 {{is not more specialized than the primary template}} // expected-note@-2 {{value of type 'const I' is not implicitly convertible to 'int'}} } // namespace t2 namespace t3 { struct J { int v = 0; constexpr J(int v) : v(v) {} }; template struct A; template struct A; template struct B; // expected-note {{template is declared here}} template struct B; // expected-error@-1 {{is not more specialized than the primary template}} // expected-note@-2 {{value of type 'const J' is not implicitly convertible to 'int'}} } // namespace t3 } // namespace GH132562 namespace GH51866 { template struct Trait; template requires T::one struct Trait {}; // #gh51866-one template requires T::two struct Trait {}; // #gh51866-two struct Y { static constexpr bool one = true; static constexpr bool two = true; }; template concept C = sizeof(Trait) != 0; static_assert(!C); Trait t; // expected-error@-1{{ambiguous partial specializations of 'Trait'}} // expected-note@#gh51866-one{{partial specialization matches}} // expected-note@#gh51866-two{{partial specialization matches}} }