1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
2 // expected-no-diagnostics
5 template <typename T
> struct X
{
9 template <> struct X
<int>::I
{
10 template <int ct
> constexpr int f() { return ct
; };
15 template <typename T
> struct X
<T
>::I
{
16 template <T ct
> constexpr T
f() { return ct
+ 1; };
20 static_assert(X
<int>::I
{}.f
<17>() == 17);
21 static_assert(X
<int>::I
{}.data
== 3);
22 static_assert(X
<short>::I
{}.data
== 7);
23 static_assert(X
<short>::I
{}.f
<18>() == 19);
25 template <typename T
> struct Y
{
29 template <> struct Y
<int> {
31 template <int ct
> constexpr int f() { return ct
; };
36 static_assert(Y
<int>::I
{}.f
<17>() == 17);
37 static_assert(Y
<int>::I
{}.data
== 3);
39 } // namespace GH61159