From f41dcd31f648d8f6215d173cd520405a14edb0b1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Wed, 30 Sep 2026 09:50:50 +0200 Subject: [PATCH] Remove stale clang ranges guards in unit-iterators2.cpp The "algorithms" and "views" sections were guarded by clang/libstdc++ checks written for a clang 15 (04/2022) bug. The first guard's condition contradicts its own comment: it skips clang+libc++ and keeps clang+libstdc++. Both sections already sit inside `#if JSON_HAS_RANGES`, which macro_scope.hpp excludes for the toolchains these guards targeted, so the inner guards never let the sections run on the platforms they meant to protect and are redundant on the rest. Verified locally with Apple clang 21/libc++ and clang 16.0.6/libstdc++ 12 (Docker): both pass all 1355 assertions with the guards removed. Part of #5713 Signed-off-by: Niels Lohmann --- tests/src/unit-iterators2.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/src/unit-iterators2.cpp b/tests/src/unit-iterators2.cpp index 6794de854..5bc738e21 100644 --- a/tests/src/unit-iterators2.cpp +++ b/tests/src/unit-iterators2.cpp @@ -893,8 +893,6 @@ TEST_CASE("iterators 2") CHECK(std::ranges::input_range); } - // libstdc++ algorithms don't work with Clang 15 (04/2022) -#if !DOCTEST_CLANG || (DOCTEST_CLANG && defined(__GLIBCXX__)) SECTION("algorithms") { SECTION("copy") @@ -929,11 +927,7 @@ TEST_CASE("iterators 2") CHECK(*it == 2); } } -#endif - // libstdc++ views don't work with Clang 15 (04/2022) - // libc++ hides limited ranges implementation behind guard macro -#if !(DOCTEST_CLANG && (defined(__GLIBCXX__) || defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES))) SECTION("views") { SECTION("reverse") @@ -966,7 +960,6 @@ TEST_CASE("iterators 2") CHECK(j_transformed == j_expected); } } -#endif } #endif }