// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s template struct A { template struct B { static constexpr int y = 0; }; template struct B { static constexpr int y = 1; }; template static constexpr int x = 0; template static constexpr int x = 1; }; template template struct A::B { static constexpr int y = 2; }; template template constexpr int A::x = 2; static_assert(A::B::y == 0); static_assert(A::B::y == 1); static_assert(A::B::y == 2); static_assert(A::x == 0); static_assert(A::x == 1); static_assert(A::x == 2); template<> template struct A::B { static constexpr int y = 3; }; template<> template struct A::B { static constexpr int y = 4; }; template<> template struct A::B { static constexpr int y = 5; }; template<> template constexpr int A::x = 3; template<> template constexpr int A::x = 4; template<> template constexpr int A::x = 5; static_assert(A::B::y == 3); static_assert(A::B::y == 3); static_assert(A::B::y == 3); // FIXME: This should pass! static_assert(A::B::y == 4); // expected-error {{static assertion failed due to requirement 'A::B::y == 4'}} // expected-note@-1 {{expression evaluates to '3 == 4'}} static_assert(A::x == 3); static_assert(A::x == 3); static_assert(A::x == 3); // FIXME: This should pass! static_assert(A::x == 4); // expected-error {{static assertion failed due to requirement 'A::x == 4'}} // expected-note@-1 {{expression evaluates to '3 == 4'}} static_assert(A::B::y == 0); static_assert(A::B::y == 1); static_assert(A::B::y == 2); static_assert(A::B::y == 5); static_assert(A::x == 0); static_assert(A::x == 1); static_assert(A::x == 2); static_assert(A::x == 5);