1 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
7 static constexpr int y
= 0;
12 static constexpr int y
= 1;
16 static constexpr int x
= 0;
19 static constexpr int x
<U
*> = 1;
25 static constexpr int y
= 2;
30 constexpr int A
<T
>::x
<U
[]> = 2;
32 static_assert(A
<short>::B
<int>::y
== 0);
33 static_assert(A
<short>::B
<int*>::y
== 1);
34 static_assert(A
<short>::B
<int[]>::y
== 2);
35 static_assert(A
<short>::x
<int> == 0);
36 static_assert(A
<short>::x
<int*> == 1);
37 static_assert(A
<short>::x
<int[]> == 2);
42 static constexpr int y
= 3;
47 struct A
<int>::B
<U
&> {
48 static constexpr int y
= 4;
53 struct A
<long>::B
<U
&> {
54 static constexpr int y
= 5;
59 constexpr int A
<int>::x
= 3;
63 constexpr int A
<int>::x
<U
&> = 4;
67 constexpr int A
<long>::x
<U
&> = 5;
69 static_assert(A
<int>::B
<int>::y
== 3);
70 static_assert(A
<int>::B
<int*>::y
== 3);
71 static_assert(A
<int>::B
<int[]>::y
== 3);
73 // FIXME: This should pass!
74 static_assert(A
<int>::B
<int&>::y
== 4); // expected-error {{static assertion failed due to requirement 'A<int>::B<int &>::y == 4'}}
75 // expected-note@-1 {{expression evaluates to '3 == 4'}}
76 static_assert(A
<int>::x
<int> == 3);
77 static_assert(A
<int>::x
<int*> == 3);
78 static_assert(A
<int>::x
<int[]> == 3);
80 // FIXME: This should pass!
81 static_assert(A
<int>::x
<int&> == 4); // expected-error {{static assertion failed due to requirement 'A<int>::x<int &> == 4'}}
82 // expected-note@-1 {{expression evaluates to '3 == 4'}}
83 static_assert(A
<long>::B
<int>::y
== 0);
84 static_assert(A
<long>::B
<int*>::y
== 1);
85 static_assert(A
<long>::B
<int[]>::y
== 2);
86 static_assert(A
<long>::B
<int&>::y
== 5);
87 static_assert(A
<long>::x
<int> == 0);
88 static_assert(A
<long>::x
<int*> == 1);
89 static_assert(A
<long>::x
<int[]> == 2);
90 static_assert(A
<long>::x
<int&> == 5);