Skip to content

Commit a839614

Browse files
committed
Make tests of flat_[multi]{set, map} constexpr only from C++26 onwards.
1 parent 00c8e61 commit a839614

File tree

71 files changed

+144
-144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+144
-144
lines changed

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.access/at_transparent.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static_assert(!CanAt<NonTransparentMap>);
3535
static_assert(!CanAt<const NonTransparentMap>);
3636

3737
template <class KeyContainer, class ValueContainer>
38-
constexpr void test() {
38+
TEST_CONSTEXPR_CXX26 void test() {
3939
using P = std::pair<int, double>;
4040
P ar[] = {
4141
P(1, 1.5),
@@ -97,7 +97,7 @@ constexpr void test() {
9797
}
9898
}
9999

100-
constexpr bool test() {
100+
TEST_CONSTEXPR_CXX26 bool test() {
101101
test<std::vector<int>, std::vector<double>>();
102102
#ifndef __cpp_lib_constexpr_deque
103103
if (!TEST_IS_CONSTANT_EVALUATED)

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.access/index_transparent.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static_assert(!CanIndex<TransparentMap, TransparentMap::iterator>);
5050
static_assert(!CanIndex<TransparentMap, TransparentMap::const_iterator>);
5151

5252
template <class KeyContainer, class ValueContainer>
53-
constexpr void test() {
53+
TEST_CONSTEXPR_CXX26 void test() {
5454
using P = std::pair<int, double>;
5555
P ar[] = {
5656
P(1, 1.5),
@@ -81,7 +81,7 @@ constexpr void test() {
8181
}
8282
}
8383

84-
constexpr bool test() {
84+
TEST_CONSTEXPR_CXX26 bool test() {
8585
test<std::vector<int>, std::vector<double>>();
8686
#ifndef __cpp_lib_constexpr_deque
8787
if (!TEST_IS_CONSTANT_EVALUATED)

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.capacity/max_size.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "test_allocator.h"
2525
#include "test_macros.h"
2626

27-
constexpr bool test() {
27+
TEST_CONSTEXPR_CXX26 bool test() {
2828
{
2929
using A1 = limited_allocator<int, 10>;
3030
using A2 = limited_allocator<int, 20>;

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/copy_assign.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "test_allocator.h"
2525

2626
template <template <class...> class KeyContainer, template <class...> class ValueContainer>
27-
constexpr void test() {
27+
TEST_CONSTEXPR_CXX26 void test() {
2828
{
2929
// test_allocator is not propagated
3030
using C = test_less<int>;
@@ -93,7 +93,7 @@ constexpr void test() {
9393
}
9494
}
9595

96-
constexpr bool test() {
96+
TEST_CONSTEXPR_CXX26 bool test() {
9797
test<std::vector, std::vector>();
9898

9999
#ifndef __cpp_lib_constexpr_deque

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/initializer_list.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct DefaultCtableComp {
3636
};
3737

3838
template <template <class...> class KeyContainer, template <class...> class ValueContainer>
39-
constexpr void test() {
39+
TEST_CONSTEXPR_CXX26 void test() {
4040
std::pair<int, short> expected[] = {{1, 1}, {2, 2}, {3, 3}, {5, 2}};
4141
{
4242
// flat_map(initializer_list<value_type>);
@@ -107,7 +107,7 @@ constexpr void test() {
107107
}
108108
}
109109

110-
constexpr bool test() {
110+
TEST_CONSTEXPR_CXX26 bool test() {
111111
{
112112
// The constructors in this subclause shall not participate in overload
113113
// resolution unless uses_allocator_v<key_container_type, Alloc> is true

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/iter_iter.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "../../../test_compare.h"
3434

3535
template <class KeyContainer, class ValueContainer>
36-
constexpr void test() {
36+
TEST_CONSTEXPR_CXX26 void test() {
3737
using Key = typename KeyContainer::value_type;
3838
using Value = typename ValueContainer::value_type;
3939
using P = std::pair<Key, Value>;
@@ -100,7 +100,7 @@ constexpr void test() {
100100
}
101101

102102
template <template <class...> class KeyContainer, template <class...> class ValueContainer>
103-
constexpr void test_alloc() {
103+
TEST_CONSTEXPR_CXX26 void test_alloc() {
104104
using P = std::pair<int, short>;
105105
P ar[] = {{1, 1}, {1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 6}, {2, 7}, {3, 8}, {3, 9}};
106106

@@ -178,7 +178,7 @@ constexpr void test_alloc() {
178178
}
179179
}
180180

181-
constexpr bool test() {
181+
TEST_CONSTEXPR_CXX26 bool test() {
182182
{
183183
// The constructors in this subclause shall not participate in overload
184184
// resolution unless uses_allocator_v<key_container_type, Alloc> is true

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/move_assign.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "min_allocator.h"
2828

2929
template <template <class...> class KeyContainer, template <class...> class ValueContainer>
30-
constexpr void test() {
30+
TEST_CONSTEXPR_CXX26 void test() {
3131
{
3232
using C = test_less<int>;
3333
using A1 = test_allocator<int>;
@@ -72,7 +72,7 @@ constexpr void test() {
7272
}
7373
}
7474

75-
constexpr bool test() {
75+
TEST_CONSTEXPR_CXX26 bool test() {
7676
test<std::vector, std::vector>();
7777

7878
#ifndef __cpp_lib_constexpr_deque

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/range.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static_assert(!std::is_constructible_v<Map, std::from_range_t, RangeOf<int>, std
6969
static_assert(!std::is_constructible_v<Map, std::from_range_t, RangeOf<double>, std::less<int>, std::allocator<int>>);
7070

7171
template <class KeyContainer, class ValueContainer>
72-
constexpr void test() {
72+
TEST_CONSTEXPR_CXX26 void test() {
7373
using Key = typename KeyContainer::value_type;
7474
using Value = typename ValueContainer::value_type;
7575
using P = std::pair<Key, Value>;
@@ -151,7 +151,7 @@ constexpr void test() {
151151
}
152152

153153
template <template <class...> class KeyContainer, template <class...> class ValueContainer>
154-
constexpr void test_alloc() {
154+
TEST_CONSTEXPR_CXX26 void test_alloc() {
155155
using P = std::pair<int, short>;
156156
P ar[] = {{1, 1}, {1, 2}, {1, 3}, {2, 4}, {2, 5}, {3, 6}, {2, 7}, {3, 8}, {3, 9}};
157157
{
@@ -232,7 +232,7 @@ constexpr void test_alloc() {
232232
}
233233
}
234234

235-
constexpr bool test() {
235+
TEST_CONSTEXPR_CXX26 bool test() {
236236
{
237237
// The constructors in this subclause shall not participate in overload
238238
// resolution unless uses_allocator_v<key_container_type, Alloc> is true

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/sorted_container.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "../../../test_compare.h"
3636

3737
template <template <class...> class KeyContainer, template <class...> class ValueContainer>
38-
constexpr void test() {
38+
TEST_CONSTEXPR_CXX26 void test() {
3939
{
4040
// flat_map(sorted_unique_t, key_container_type , mapped_container_type)
4141
using M = std::flat_map<int, char, std::less<int>, KeyContainer<int>, ValueContainer<char>>;
@@ -141,7 +141,7 @@ constexpr void test() {
141141
}
142142
}
143143

144-
constexpr bool test() {
144+
TEST_CONSTEXPR_CXX26 bool test() {
145145
{
146146
// The constructors in this subclause shall not participate in overload
147147
// resolution unless uses_allocator_v<key_container_type, Alloc> is true

libcxx/test/std/containers/container.adaptors/flat.map/flat.map.cons/sorted_initializer_list.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ constexpr auto il2 = il<int, short>;
3939
constexpr auto il3 = il<short, int>;
4040

4141
template <template <class...> class KeyContainer, template <class...> class ValueContainer>
42-
constexpr void test() {
42+
TEST_CONSTEXPR_CXX26 void test() {
4343
{
4444
// flat_map(sorted_unique_t, initializer_list<value_type>);
4545
using M = std::flat_map<int, int, std::less<int>, KeyContainer<int>, ValueContainer<int>>;
@@ -112,7 +112,7 @@ constexpr void test() {
112112
}
113113
}
114114

115-
constexpr bool test() {
115+
TEST_CONSTEXPR_CXX26 bool test() {
116116
{
117117
// The constructors in this subclause shall not participate in overload
118118
// resolution unless uses_allocator_v<key_container_type, Alloc> is true

0 commit comments

Comments
 (0)