Skip to content

Commit 478a468

Browse files
committed
[libc++][C++03] Introduce LIBCPP_{,NON_}FROZEN_ASSERT
1 parent 3141bde commit 478a468

File tree

6 files changed

+11
-15
lines changed

6 files changed

+11
-15
lines changed

libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
// unordered_map& operator=(const unordered_map& u);
1616

17-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
18-
1917
#include <algorithm>
2018
#include <cassert>
2119
#include <cfloat>
@@ -270,7 +268,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
270268
V rhs_arr[] = {V(10, 4), V(13, 5), V(12, 324), V(0, 54), V(50, 5), V(2, 5)};
271269
Map copy(begin(rhs_arr), end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
272270
copy = orig;
273-
LIBCPP_ASSERT(copy.bucket_count() == 5);
271+
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
274272
assert(copy.size() == 4);
275273
assert(copy.at(1) == 1);
276274
assert(copy.at(2) == 3);

libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_copy.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
// unordered_multimap& operator=(const unordered_multimap& u);
1616

17-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
18-
1917
#include <algorithm>
2018
#include <cassert>
2119
#include <cfloat>
@@ -289,7 +287,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
289287
V rhs_arr[] = {V(10, 4), V(13, 5), V(12, 324), V(0, 54), V(50, 5), V(2, 5)};
290288
Map copy(begin(rhs_arr), end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
291289
copy = orig;
292-
LIBCPP_ASSERT(copy.bucket_count() == 5);
290+
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
293291
assert(copy.size() == 4);
294292
assert(copy.find(1)->second == 1);
295293
assert(copy.find(2)->second == 3);

libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_copy.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
// unordered_multiset& operator=(const unordered_multiset& u);
1616

17-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
18-
1917
#include <algorithm>
2018
#include <cassert>
2119
#include <cfloat>
@@ -259,7 +257,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
259257
int rhs_arr[] = {10, 13, 12, 0, 50, 2};
260258
Set copy(std::begin(rhs_arr), std::end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
261259
copy = orig;
262-
LIBCPP_ASSERT(copy.bucket_count() == 5);
260+
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
263261
assert(copy.size() == 4);
264262
assert(copy.count(1) == 1);
265263
assert(copy.count(2) == 1);

libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/assign_copy.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
// unordered_set& operator=(const unordered_set& u);
1616

17-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
18-
1917
#include <algorithm>
2018
#include <cassert>
2119
#include <cfloat>
@@ -262,7 +260,7 @@ void test_alloc(const Alloc& lhs_alloc = Alloc(),
262260
int rhs_arr[] = {10, 13, 12, 0, 50, 2};
263261
Set copy(std::begin(rhs_arr), std::end(rhs_arr), 0, std::hash<int>(), std::equal_to<int>(), rhs_alloc);
264262
copy = orig;
265-
LIBCPP_ASSERT(copy.bucket_count() == 5);
263+
LIBCPP_NON_FROZEN_ASSERT(copy.bucket_count() == 5);
266264
assert(copy.size() == 4);
267265
assert(copy.count(1) == 1);
268266
assert(copy.count(2) == 1);

libcxx/test/std/localization/locale.categories/category.numeric/locale.nm.put/facet.num.put.members/put_pointer.pass.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
// iter_type put(iter_type s, ios_base& iob, char_type fill, void* v) const;
1414

15-
// XFAIL: FROZEN-CXX03-HEADERS-FIXME
16-
1715
#include <cassert>
1816
#include <ios>
1917
#include <locale>
@@ -36,7 +34,7 @@ int main(int, char**) {
3634
cpp17_output_iterator<char*> iter = f.put(cpp17_output_iterator<char*>(str), ios, '*', v);
3735
std::string ex(str, base(iter));
3836
assert(!ex.empty());
39-
LIBCPP_ASSERT(ex == "0");
37+
LIBCPP_NON_FROZEN_ASSERT(ex == "0");
4038
}
4139

4240
return 0;

libcxx/test/support/test_macros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,12 @@
264264
#define LIBCPP_ONLY(...) static_assert(true, "")
265265
#endif
266266

267+
#ifdef _LIBCPP_USE_FROZEN_CXX03_HEADERS
268+
# define LIBCPP_NON_FROZEN_ASSERT(...) static_assert(true, "")
269+
#else
270+
# define LIBCPP_NON_FROZEN_ASSERT(...) LIBCPP_ASSERT(__VA_ARGS__)
271+
#endif
272+
267273
#if __has_cpp_attribute(nodiscard)
268274
# define TEST_NODISCARD [[nodiscard]]
269275
#else

0 commit comments

Comments
 (0)