Skip to content

Commit 792f0c1

Browse files
committed
[FOLD] add tests with out-of-line partial specializations
1 parent a3356a0 commit 792f0c1

File tree

1 file changed

+30
-14
lines changed
  • clang/test/CXX/temp/temp.decls/temp.spec.partial/temp.spec.partial.member

1 file changed

+30
-14
lines changed

clang/test/CXX/temp/temp.decls/temp.spec.partial/temp.spec.partial.member/p2.cpp

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,50 +20,66 @@ struct A {
2020
static constexpr int x<U*> = 1;
2121
};
2222

23+
template<typename T>
24+
template<typename U>
25+
struct A<T>::B<U[]> {
26+
static constexpr int y = 2;
27+
};
28+
29+
template<typename T>
30+
template<typename U>
31+
constexpr int A<T>::x<U[]> = 2;
32+
2333
static_assert(A<short>::B<int>::y == 0);
2434
static_assert(A<short>::B<int*>::y == 1);
35+
static_assert(A<short>::B<int[]>::y == 2);
2536
static_assert(A<short>::x<int> == 0);
2637
static_assert(A<short>::x<int*> == 1);
38+
static_assert(A<short>::x<int[]> == 2);
2739

2840
template<>
2941
template<typename U>
3042
struct A<int>::B {
31-
static constexpr int y = 2;
43+
static constexpr int y = 3;
3244
};
3345

3446
template<>
3547
template<typename U>
3648
struct A<int>::B<U&> {
37-
static constexpr int y = 3;
49+
static constexpr int y = 4;
3850
};
3951

4052
template<>
4153
template<typename U>
4254
struct A<long>::B<U&> {
43-
static constexpr int y = 4;
55+
static constexpr int y = 5;
4456
};
4557

4658
template<>
4759
template<typename U>
48-
constexpr int A<int>::x = 2;
60+
constexpr int A<int>::x = 3;
4961

5062
template<>
5163
template<typename U>
52-
constexpr int A<int>::x<U&> = 3;
64+
constexpr int A<int>::x<U&> = 4;
5365

5466
template<>
5567
template<typename U>
56-
constexpr int A<long>::x<U&> = 4;
68+
constexpr int A<long>::x<U&> = 5;
5769

58-
static_assert(A<int>::B<int>::y == 2);
59-
static_assert(A<int>::B<int*>::y == 2);
60-
static_assert(A<int>::B<int&>::y == 3);
61-
static_assert(A<int>::x<int> == 2);
62-
static_assert(A<int>::x<int*> == 2);
63-
static_assert(A<int>::x<int&> == 3);
70+
static_assert(A<int>::B<int>::y == 3);
71+
static_assert(A<int>::B<int*>::y == 3);
72+
static_assert(A<int>::B<int[]>::y == 3);
73+
static_assert(A<int>::B<int&>::y == 4);
74+
static_assert(A<int>::x<int> == 3);
75+
static_assert(A<int>::x<int*> == 3);
76+
static_assert(A<int>::x<int[]> == 3);
77+
static_assert(A<int>::x<int&> == 4);
6478
static_assert(A<long>::B<int>::y == 0);
6579
static_assert(A<long>::B<int*>::y == 1);
66-
static_assert(A<long>::B<int&>::y == 4);
80+
static_assert(A<long>::B<int[]>::y == 2);
81+
static_assert(A<long>::B<int&>::y == 5);
6782
static_assert(A<long>::x<int> == 0);
6883
static_assert(A<long>::x<int*> == 1);
69-
static_assert(A<long>::x<int&> == 4);
84+
static_assert(A<long>::x<int[]> == 2);
85+
static_assert(A<long>::x<int&> == 5);

0 commit comments

Comments
 (0)