[libcxx-commits] [libcxx] [libc++][C++03] Remove code in the C++03-specific tests that is guarded on the language version (PR #169354)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Nov 27 06:39:43 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
<details>
<summary>Changes</summary>
This is dead code, since `test/libcxx-03` is only ever executed with `-std=c++03`.
---
Patch is 91.62 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/169354.diff
38 Files Affected:
- (modified) libcxx/test/libcxx-03/algorithms/half_positive.pass.cpp (-12)
- (modified) libcxx/test/libcxx-03/algorithms/robust_against_copying_comparators.pass.cpp (-69)
- (modified) libcxx/test/libcxx-03/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp (-25)
- (modified) libcxx/test/libcxx-03/containers/sequences/vector/asan.pass.cpp (-23)
- (modified) libcxx/test/libcxx-03/containers/sequences/vector/asan_throw.pass.cpp (-37)
- (modified) libcxx/test/libcxx-03/depr/depr.default.allocator/allocator.members/construct.cxx20.pass.cpp (-53)
- (modified) libcxx/test/libcxx-03/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp (-94)
- (modified) libcxx/test/libcxx-03/iterators/bounded_iter/arithmetic.pass.cpp (-8)
- (modified) libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp (-17)
- (modified) libcxx/test/libcxx-03/iterators/bounded_iter/pointer_traits.pass.cpp (-12)
- (modified) libcxx/test/libcxx-03/iterators/bounded_iter/types.compile.pass.cpp (-23)
- (modified) libcxx/test/libcxx-03/iterators/contiguous_iterators.conv.compile.pass.cpp (-9)
- (modified) libcxx/test/libcxx-03/iterators/contiguous_iterators.pass.cpp (-89)
- (modified) libcxx/test/libcxx-03/iterators/predef.iterators/insert.iterators/back.insert.iter.ops/get_container.pass.cpp (+1-5)
- (modified) libcxx/test/libcxx-03/iterators/unwrap_iter.pass.cpp (-3)
- (modified) libcxx/test/libcxx-03/language.support/support.dynamic/libcpp_deallocate.sh.cpp (-7)
- (modified) libcxx/test/libcxx-03/libcpp_alignof.pass.cpp (-3)
- (modified) libcxx/test/libcxx-03/memory/allocation_guard.pass.cpp (-4)
- (modified) libcxx/test/libcxx-03/memory/swap_allocator.pass.cpp (-19)
- (modified) libcxx/test/libcxx-03/numerics/bit.ops.pass.cpp (-3)
- (modified) libcxx/test/libcxx-03/strings/basic.string/string.capacity/max_size.pass.cpp (-3)
- (modified) libcxx/test/libcxx-03/strings/basic.string/string.cons/copy_shrunk_long.pass.cpp (-8)
- (modified) libcxx/test/libcxx-03/strings/c.strings/constexpr_memmove.pass.cpp (+1-3)
- (modified) libcxx/test/libcxx-03/type_traits/is_trivially_relocatable.compile.pass.cpp (-52)
- (modified) libcxx/test/libcxx-03/utilities/function.objects/func.require/bullet_1_2_3.pass.cpp (-164)
- (modified) libcxx/test/libcxx-03/utilities/function.objects/func.require/bullet_4_5_6.pass.cpp (-32)
- (modified) libcxx/test/libcxx-03/utilities/function.objects/func.require/bullet_7.pass.cpp (-88)
- (modified) libcxx/test/libcxx-03/utilities/function.objects/func.require/invoke.pass.cpp (-12)
- (modified) libcxx/test/libcxx-03/utilities/function.objects/func.require/invoke_helpers.h (-17)
- (modified) libcxx/test/libcxx-03/utilities/is_pointer_in_range.pass.cpp (-17)
- (modified) libcxx/test/libcxx-03/utilities/is_valid_range.pass.cpp (-11)
- (modified) libcxx/test/libcxx-03/utilities/memory/pointer.conversion/to_address.pass.cpp (+1-3)
- (modified) libcxx/test/libcxx-03/utilities/memory/pointer.conversion/to_address_std_iterators.pass.cpp (-6)
- (modified) libcxx/test/libcxx-03/utilities/meta/is_referenceable.compile.pass.cpp (-108)
- (modified) libcxx/test/libcxx-03/utilities/no_destroy.pass.cpp (-5)
- (modified) libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.non_trivial_copy_move.pass.cpp (-97)
- (modified) libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.trivial_copy_move.pass.cpp (-105)
- (modified) libcxx/test/libcxx-03/utilities/utility/pairs/pairs.pair/abi.trivially_copyable.compile.pass.cpp (-5)
``````````diff
diff --git a/libcxx/test/libcxx-03/algorithms/half_positive.pass.cpp b/libcxx/test/libcxx-03/algorithms/half_positive.pass.cpp
index 292fcf356554b..ad0cac2a1bd65 100644
--- a/libcxx/test/libcxx-03/algorithms/half_positive.pass.cpp
+++ b/libcxx/test/libcxx-03/algorithms/half_positive.pass.cpp
@@ -41,17 +41,5 @@ int main(int, char**)
#endif // !defined(TEST_HAS_NO_INT128)
}
-#if TEST_STD_VER >= 11
- {
- static_assert(test<char>(), "");
- static_assert(test<int>(), "");
- static_assert(test<long>(), "");
- static_assert(test<std::size_t>(), "");
-#if !defined(TEST_HAS_NO_INT128)
- static_assert(test<__int128_t>(), "");
-#endif // !defined(TEST_HAS_NO_INT128)
- }
-#endif // TEST_STD_VER >= 11
-
return 0;
}
diff --git a/libcxx/test/libcxx-03/algorithms/robust_against_copying_comparators.pass.cpp b/libcxx/test/libcxx-03/algorithms/robust_against_copying_comparators.pass.cpp
index 256251686bb3e..2e3fc6db45c93 100644
--- a/libcxx/test/libcxx-03/algorithms/robust_against_copying_comparators.pass.cpp
+++ b/libcxx/test/libcxx-03/algorithms/robust_against_copying_comparators.pass.cpp
@@ -82,17 +82,6 @@ struct BinaryTransform {
TEST_CONSTEXPR T operator()(T, T) const { return 0; }
};
-#if TEST_STD_VER > 17
-template <class T>
-struct ThreeWay {
- int* copies_;
- constexpr explicit ThreeWay(int* copies) : copies_(copies) {}
- constexpr ThreeWay(const ThreeWay& rhs) : copies_(rhs.copies_) { *copies_ += 1; }
- constexpr ThreeWay& operator=(const ThreeWay&) = default;
- constexpr std::strong_ordering operator()(T, T) const { return std::strong_ordering::equal; }
-};
-#endif
-
template <class T>
TEST_CONSTEXPR_CXX20 bool all_the_algorithms() {
T a[10] = {};
@@ -109,28 +98,14 @@ TEST_CONSTEXPR_CXX20 bool all_the_algorithms() {
int copies = 0;
(void)std::adjacent_find(first, last, Equal<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER >= 11
- (void)std::all_of(first, last, UnaryTrue<T>(&copies));
- assert(copies == 0);
- (void)std::any_of(first, last, UnaryTrue<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::binary_search(first, last, value, Less<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER > 17
- (void)std::clamp(value, value, value, Less<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::count_if(first, last, UnaryTrue<T>(&copies));
assert(copies == 0);
(void)std::copy_if(first, last, first2, UnaryTrue<T>(&copies));
assert(copies == 0);
(void)std::equal(first, last, first2, Equal<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER > 11
- (void)std::equal(first, last, first2, last2, Equal<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::equal_range(first, last, value, Less<T>(&copies));
assert(copies == 0);
(void)std::find_end(first, last, first2, mid2, Equal<T>(&copies));
@@ -144,10 +119,6 @@ TEST_CONSTEXPR_CXX20 bool all_the_algorithms() {
(void)std::for_each(first, last, UnaryVoid<T>(&copies));
assert(copies == 1);
copies = 0;
-#if TEST_STD_VER > 14
- (void)std::for_each_n(first, count, UnaryVoid<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::generate(first, last, NullaryValue<T>(&copies));
assert(copies == 0);
(void)std::generate_n(first, count, NullaryValue<T>(&copies));
@@ -162,10 +133,6 @@ TEST_CONSTEXPR_CXX20 bool all_the_algorithms() {
assert(copies == 0);
(void)std::is_permutation(first, last, first2, Equal<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER > 11
- (void)std::is_permutation(first, last, first2, last2, Equal<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::is_sorted(first, last, Less<T>(&copies));
assert(copies == 0);
(void)std::is_sorted_until(first, last, Less<T>(&copies));
@@ -176,52 +143,28 @@ TEST_CONSTEXPR_CXX20 bool all_the_algorithms() {
}
(void)std::lexicographical_compare(first, last, first2, last2, Less<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER > 17
- (void)std::lexicographical_compare_three_way(first, last, first2, last2, ThreeWay<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::lower_bound(first, last, value, Less<T>(&copies));
assert(copies == 0);
(void)std::make_heap(first, last, Less<T>(&copies));
assert(copies == 0);
(void)std::max(value, value, Less<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER >= 11
- (void)std::max({value, value}, Less<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::max_element(first, last, Less<T>(&copies));
assert(copies == 0);
(void)std::merge(first, mid, mid, last, first2, Less<T>(&copies));
assert(copies == 0);
(void)std::min(value, value, Less<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER >= 11
- (void)std::min({value, value}, Less<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::min_element(first, last, Less<T>(&copies));
assert(copies == 0);
(void)std::minmax(value, value, Less<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER >= 11
- (void)std::minmax({value, value}, Less<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::minmax_element(first, last, Less<T>(&copies));
assert(copies == 0);
(void)std::mismatch(first, last, first2, Equal<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER > 11
- (void)std::mismatch(first, last, first2, last2, Equal<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::next_permutation(first, last, Less<T>(&copies));
assert(copies == 0);
-#if TEST_STD_VER >= 11
- (void)std::none_of(first, last, UnaryTrue<T>(&copies));
- assert(copies == 0);
-#endif
(void)std::nth_element(first, mid, last, Less<T>(&copies));
assert(copies == 0);
(void)std::partial_sort(first, mid, last, Less<T>(&copies));
@@ -299,14 +242,6 @@ bool test_segmented_iterator() {
assert(copies == 1);
copies = 0;
-#if TEST_STD_VER >= 20
- std::vector<std::vector<int>> vecs(3, std::vector<int>(10));
- auto v = std::views::join(vecs);
- (void)std::for_each(v.begin(), v.end(), UnaryVoid<int>(&copies));
- assert(copies == 1);
- copies = 0;
-#endif
-
return true;
}
@@ -314,10 +249,6 @@ int main(int, char**) {
all_the_algorithms<void*>();
all_the_algorithms<int>();
assert(test_segmented_iterator());
-#if TEST_STD_VER > 17
- static_assert(all_the_algorithms<void*>());
- static_assert(all_the_algorithms<int>());
-#endif
return 0;
}
diff --git a/libcxx/test/libcxx-03/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp b/libcxx/test/libcxx-03/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp
index 03fef57ee259a..009a234030198 100644
--- a/libcxx/test/libcxx-03/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp
+++ b/libcxx/test/libcxx-03/algorithms/robust_against_cpp20_hostile_iterators.compile.pass.cpp
@@ -99,10 +99,6 @@ void test() {
(void) std::equal_range(it, it, 0, pred);
(void) std::equal(it, it, it);
(void) std::equal(it, it, it, pred);
-#if TEST_STD_VER > 11
- (void) std::equal(it, it, it, it);
- (void) std::equal(it, it, it, it, pred);
-#endif
(void) std::fill_n(it, 0, 0);
(void) std::fill(it, it, 0);
(void) std::find_end(it, it, it, it);
@@ -112,9 +108,6 @@ void test() {
(void) std::find_if_not(it, it, pred);
(void) std::find_if(it, it, pred);
(void) std::find(it, it, 0);
-#if TEST_STD_VER > 14
- (void) std::for_each_n(it, 0, pred);
-#endif
(void) std::for_each(it, it, pred);
(void) std::generate_n(it, 0, pred);
(void) std::generate(it, it, pred);
@@ -129,20 +122,12 @@ void test() {
(void) std::is_partitioned(it, it, pred);
(void) std::is_permutation(it, it, it);
(void) std::is_permutation(it, it, it, pred);
-#if TEST_STD_VER > 11
- (void) std::is_permutation(it, it, it, it);
- (void) std::is_permutation(it, it, it, it, pred);
-#endif
(void) std::is_sorted_until(it, it);
(void) std::is_sorted_until(it, it, pred);
(void) std::is_sorted(it, it);
(void) std::is_sorted(it, it, pred);
(void) std::lexicographical_compare(it, it, it, it);
(void) std::lexicographical_compare(it, it, it, it, pred);
-#if TEST_STD_VER > 17
- (void)std::lexicographical_compare_three_way(it, it, it, it);
- (void)std::lexicographical_compare_three_way(it, it, it, it, std::compare_three_way());
-#endif
(void) std::lower_bound(it, it, 0);
(void) std::lower_bound(it, it, 0, pred);
(void) std::make_heap(it, it);
@@ -189,14 +174,8 @@ void test() {
(void) std::reverse(it, it);
(void) std::rotate_copy(it, it, it, it);
(void) std::rotate(it, it, it);
-#if TEST_STD_VER > 14
- (void) std::sample(it, it, it, 0, rng);
-#endif
(void) std::search(it, it, it, it);
(void) std::search(it, it, it, it, pred);
-#if TEST_STD_VER > 14
- (void) std::search(it, it, std::default_searcher<Cpp20HostileIterator<int*>>(it, it));
-#endif
(void) std::set_difference(it, it, it, it, it);
(void) std::set_difference(it, it, it, it, it, pred);
(void) std::set_intersection(it, it, it, it, it);
@@ -205,10 +184,6 @@ void test() {
(void) std::set_symmetric_difference(it, it, it, it, it, pred);
(void) std::set_union(it, it, it, it, it);
(void) std::set_union(it, it, it, it, it, pred);
-#if TEST_STD_VER > 17
- (void) std::shift_left(it, it, 0);
- (void) std::shift_right(it, it, 0);
-#endif
(void) std::shuffle(it, it, rng);
(void) std::sort_heap(it, it);
(void) std::sort_heap(it, it, pred);
diff --git a/libcxx/test/libcxx-03/containers/sequences/vector/asan.pass.cpp b/libcxx/test/libcxx-03/containers/sequences/vector/asan.pass.cpp
index 03d2b3e6ce9b9..72875a52246c4 100644
--- a/libcxx/test/libcxx-03/containers/sequences/vector/asan.pass.cpp
+++ b/libcxx/test/libcxx-03/containers/sequences/vector/asan.pass.cpp
@@ -26,29 +26,6 @@ extern "C" void __sanitizer_set_death_callback(void (*callback)(void));
void do_exit() { exit(0); }
int main(int, char**) {
-#if TEST_STD_VER >= 11
- {
- typedef int T;
- typedef cpp17_input_iterator<T*> MyInputIter;
- std::vector<T, min_allocator<T>> v;
- v.reserve(1);
- int i[] = {42};
- v.insert(v.begin(), MyInputIter(i), MyInputIter(i + 1));
- assert(v[0] == 42);
- assert(is_contiguous_container_asan_correct(v));
- }
- {
- typedef char T;
- typedef cpp17_input_iterator<T*> MyInputIter;
- std::vector<T, unaligned_allocator<T>> v;
- v.reserve(1);
- char i[] = {'a', 'b'};
- v.insert(v.begin(), MyInputIter(i), MyInputIter(i + 2));
- assert(v[0] == 'a');
- assert(v[1] == 'b');
- assert(is_contiguous_container_asan_correct(v));
- }
-#endif // TEST_STD_VER >= 11
{
typedef cpp17_input_iterator<int*> MyInputIter;
// Sould not trigger ASan.
diff --git a/libcxx/test/libcxx-03/containers/sequences/vector/asan_throw.pass.cpp b/libcxx/test/libcxx-03/containers/sequences/vector/asan_throw.pass.cpp
index dcfa8029cfc0d..c18242af4ed3c 100644
--- a/libcxx/test/libcxx-03/containers/sequences/vector/asan_throw.pass.cpp
+++ b/libcxx/test/libcxx-03/containers/sequences/vector/asan_throw.pass.cpp
@@ -68,23 +68,6 @@ void test_push_back() {
assert(is_contiguous_container_asan_correct(v));
}
-void test_emplace_back() {
-#if TEST_STD_VER >= 11
- std::vector<X> v;
- v.reserve(2);
- v.push_back(X(2));
- assert(v.size() == 1);
- try {
- v.emplace_back(42);
- assert(0);
- } catch (int e) {
- assert(v.size() == 1);
- }
- assert(v.size() == 1);
- assert(is_contiguous_container_asan_correct(v));
-#endif
-}
-
void test_insert_range() {
std::vector<X> v;
v.reserve(4);
@@ -119,24 +102,6 @@ void test_insert() {
assert(is_contiguous_container_asan_correct(v));
}
-void test_emplace() {
-#if TEST_STD_VER >= 11
- std::vector<X> v;
- v.reserve(3);
- v.insert(v.end(), X(1));
- v.insert(v.begin(), X(2));
- assert(v.size() == 2);
- try {
- v.emplace(v.end(), 42);
- assert(0);
- } catch (int e) {
- assert(v.size() == 2);
- }
- assert(v.size() == 2);
- assert(is_contiguous_container_asan_correct(v));
-#endif
-}
-
void test_insert_range2() {
std::vector<X> v;
v.reserve(4);
@@ -219,10 +184,8 @@ void test_resize_param() {
int main(int, char**) {
test_push_back();
- test_emplace_back();
test_insert_range();
test_insert();
- test_emplace();
test_insert_range2();
test_insert_n();
test_insert_n2();
diff --git a/libcxx/test/libcxx-03/depr/depr.default.allocator/allocator.members/construct.cxx20.pass.cpp b/libcxx/test/libcxx-03/depr/depr.default.allocator/allocator.members/construct.cxx20.pass.cpp
index 9a37cf8af8e69..4e1cda55c991d 100644
--- a/libcxx/test/libcxx-03/depr/depr.default.allocator/allocator.members/construct.cxx20.pass.cpp
+++ b/libcxx/test/libcxx-03/depr/depr.default.allocator/allocator.members/construct.cxx20.pass.cpp
@@ -38,24 +38,6 @@ struct A {
int move_only_constructed = 0;
-#if TEST_STD_VER >= 11
-class move_only {
- move_only(const move_only&) = delete;
- move_only& operator=(const move_only&) = delete;
-
-public:
- move_only(move_only&&) { ++move_only_constructed; }
- move_only& operator=(move_only&&) { return *this; }
-
- move_only() { ++move_only_constructed; }
- ~move_only() { --move_only_constructed; }
-
-public:
- int data; // unused other than to make sizeof(move_only) == sizeof(int).
- // but public to suppress "-Wunused-private-field"
-};
-#endif // TEST_STD_VER >= 11
-
int main(int, char**) {
globalMemCounter.reset();
{
@@ -107,41 +89,6 @@ int main(int, char**) {
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(A_constructed == 0);
}
-#if TEST_STD_VER >= 11
- {
- std::allocator<move_only> a;
- assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(move_only_constructed == 0);
-
- globalMemCounter.last_new_size = 0;
- move_only* ap = a.allocate(3);
- DoNotOptimize(ap);
- assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int)));
- assert(move_only_constructed == 0);
-
- a.construct(ap);
- assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(move_only_constructed == 1);
-
- a.destroy(ap);
- assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(move_only_constructed == 0);
-
- a.construct(ap, move_only());
- assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(move_only_constructed == 1);
-
- a.destroy(ap);
- assert(globalMemCounter.checkOutstandingNewEq(1));
- assert(move_only_constructed == 0);
-
- a.deallocate(ap, 3);
- DoNotOptimize(ap);
- assert(globalMemCounter.checkOutstandingNewEq(0));
- assert(move_only_constructed == 0);
- }
-#endif
return 0;
}
diff --git a/libcxx/test/libcxx-03/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp b/libcxx/test/libcxx-03/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp
index d6caa3389b8fa..b6cc6e506ff32 100644
--- a/libcxx/test/libcxx-03/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp
+++ b/libcxx/test/libcxx-03/input.output/string.streams/stringbuf/const_sso_buffer.pass.cpp
@@ -20,7 +20,6 @@
#include <cassert>
#include "test_macros.h"
-#include "min_allocator.h"
template <class CharT>
struct test_buf : public std::basic_stringbuf<CharT> {
@@ -40,29 +39,6 @@ struct test_buf : public std::basic_stringbuf<CharT> {
explicit test_buf(std::ios_base::openmode which) : std::basic_stringbuf<CharT>(which) {}
explicit test_buf(const std::basic_string<CharT>& s) : std::basic_stringbuf<CharT>(s) {}
-#if TEST_STD_VER >= 20
- explicit test_buf(const std::allocator<CharT>& a) : std::basic_stringbuf<CharT>(a) {}
- test_buf(std::ios_base::openmode which, const std::allocator<CharT>& a) : std::basic_stringbuf<CharT>(which, a) {}
- explicit test_buf(std::basic_string<CharT>&& s)
- : std::basic_stringbuf<CharT>(std::forward<std::basic_string<CharT>>(s)) {}
-
- test_buf(const std::basic_string<CharT, std::char_traits<CharT>, min_allocator<CharT>>& s,
- const std::allocator<CharT>& a)
- : std::basic_stringbuf<CharT>(s, a) {}
- test_buf(const std::basic_string<CharT, std::char_traits<CharT>, min_allocator<CharT>>& s,
- std::ios_base::openmode which,
- const std::allocator<CharT>& a)
- : std::basic_stringbuf<CharT>(s, which, a) {}
- test_buf(const std::basic_string<CharT, std::char_traits<CharT>, min_allocator<CharT>>& s)
- : std::basic_stringbuf<CharT>(s) {}
-#endif // TEST_STD_VER >= 20
-
-#if TEST_STD_VER >= 26
- test_buf(std::basic_string_view<CharT> s) : std::basic_stringbuf<CharT>(s) {}
- test_buf(std::basic_string_view<CharT> s, const std::allocator<CharT>& a) : std::basic_stringbuf<CharT>(s, a) {}
- test_buf(std::basic_string_view<CharT> s, std::ios_base::openmode which, const std::allocator<CharT>& a)
- : std::basic_stringbuf<CharT>(s, which, a) {}
-#endif // TEST_STD_VER >= 26
};
template <class CharT>
@@ -88,76 +64,6 @@ static void test() {
assert(b.pptr() == b.pbase());
assert(b.epptr() == b.pbase() + size); // copy so uses size
}
-#if TEST_STD_VER >= 20
- {
- test_buf<CharT> b = test_buf<CharT>(std::allocator<CharT>());
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size);
- }
- {
- test_buf<CharT> b = test_buf<CharT>(std::ios_base::out, std::allocator<CharT>());
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size);
- }
- {
- std::basic_string<CharT> s;
- s.reserve(1024);
- std::size_t capacity = s.capacity();
- test_buf<CharT> b = test_buf<CharT>(std::move(s));
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() >= b.pbase() + capacity); // move so uses s.capacity()
- }
- {
- std::basic_string<CharT, std::char_traits<CharT>, min_allocator<CharT>> s;
- s.reserve(1024);
- test_buf<CharT> b = test_buf<CharT>(s, std::allocator<CharT>());
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size); // copy so uses size
- }
- {
- std::basic_string<CharT, std::char_traits<CharT>, min_allocator<CharT>> s;
- s.reserve(1024);
- test_buf<CharT> b = test_buf<CharT>(s, std::ios_base::out, std::allocator<CharT>());
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size); // copy so uses size
- }
- {
- std::basic_string<CharT, std::char_traits<CharT>, min_allocator<CharT>> s;
- s.reserve(1024);
- test_buf<CharT> b = test_buf<CharT>(s);
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size); // copy so uses size
- }
-#endif // TEST_STD_VER >= 20
-#if TEST_STD_VER >= 26
- {
- std::basic_string_view<CharT> s;
- test_buf<CharT> b = test_buf<CharT>(s);
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size);
- }
- {
- std::basic_string_view<CharT> s;
- test_buf<CharT> b = test_buf<CharT>(s, std::allocator<CharT>());
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size);
- }
- {
- std::basic_string_view<CharT> s;
- test_buf<CharT> b = test_buf<CharT>(s, std::ios_base::out, std::allocator<CharT>());
- assert(b.pbase() != nullptr);
- assert(b.pptr() == b.pbase());
- assert(b.epptr() == b.pbase() + size);
- }
-#endif // TEST_STD_VER >= 26
}
int main(int, char**) {
diff --git a/libcxx/test/libcxx-03/iterators/bounded_iter/arithmetic.pass.cpp b/libcxx/test/libcxx-03/iterators/bounded_iter/arithmetic.pass.cpp
index b4b6e7fa1940c..b5b6916ab1a51 100644
--- a/libcxx/test/libcxx-03/iterators/bounded_iter/arithmetic.pass.cpp
+++ b/libcxx/test/libcxx-03/iterators/bounded_iter/arithmetic.pass.cpp
@@ -99,14 +99,6 @@ TEST_CONSTEXPR_CXX14 bool tests() {
int main(int, char**) {
tests<int*>();
-#if TEST_STD_VER > 11
- static_assert(tests<int*>(), "");
-#endif
-
-#if TEST_STD_VER > 17
- tests<contiguous_iterator<int*> >();
- static_assert(tests<contiguous_iterator<int*> >(), "");
-#endif
return 0;
}
diff --git a/libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp b/libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp
index 490bfed54a159..9c6ce283f53d9 100644
--- a/libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp
+++ b/libcxx/test/libc...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/169354
More information about the libcxx-commits
mailing list