From 166a7d719b7544a0b0b840eed7ac8401eb16d3c8 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 10 Jul 2026 12:14:15 +0200 Subject: [PATCH] Fix ci_icpc: exclude classic ICC from the std::span regression test Bumping to Intel's official intel/oneapi-hpckit:2023.2.1 image (see previous commit) also bumped classic icc/icpc from 2021.5.0 to 2021.10.0. The newer version's __has_include() now returns true, but it still can't actually compile std::span/std::as_bytes usage: error: namespace "std" has no member "as_bytes" error: namespace "std" has no member "span" Exclude __ICC/__INTEL_COMPILER the same way _LIBCPP_VERSION is already excluded for issue #4490. Signed-off-by: Niels Lohmann --- tests/src/unit-regression2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp index 3be8f9d5c..519cab7e6 100644 --- a/tests/src/unit-regression2.cpp +++ b/tests/src/unit-regression2.cpp @@ -798,7 +798,9 @@ TEST_CASE("regression tests 2") #ifdef JSON_HAS_CPP_20 #ifndef _LIBCPP_VERSION // see https://github.com/nlohmann/json/issues/4490 -#if __has_include() +// classic Intel ICC reports as includable but cannot actually compile +// std::span/std::as_bytes usage below +#if __has_include() && !defined(__ICC) && !defined(__INTEL_COMPILER) SECTION("issue #2546 - parsing containers of std::byte") { const char DATA[] = R"("Hello, world!")"; // NOLINT(misc-const-correctness,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)