// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s // expected-no-diagnostics namespace GH61159 { template struct X { struct I; }; template <> struct X::I { template constexpr int f() { return ct; }; int data = 3; }; template struct X::I { template constexpr T f() { return ct + 1; }; T data = 7; }; static_assert(X::I{}.f<17>() == 17); static_assert(X::I{}.data == 3); static_assert(X::I{}.data == 7); static_assert(X::I{}.f<18>() == 19); template struct Y { struct I; }; template <> struct Y { struct I { template constexpr int f() { return ct; }; int data = 3; }; }; static_assert(Y::I{}.f<17>() == 17); static_assert(Y::I{}.data == 3); } // namespace GH61159