From e66a55066e0452cbf57226433cf294bf559629cb Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 21 Aug 2026 03:19:53 +0200 Subject: [PATCH] Include where the split moved its only use The #2546 test case guards itself with __has_include(), but the include itself sat in unit-regression2.cpp's preamble and stayed behind, so the section compiled without a declaration wherever the guard passed - which nvhpc reported and libc++ builds do not, as they skip the section altogether. Signed-off-by: Niels Lohmann --- tests/src/unit-regression3.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/src/unit-regression3.cpp b/tests/src/unit-regression3.cpp index e9ae61a6a..c65321c84 100644 --- a/tests/src/unit-regression3.cpp +++ b/tests/src/unit-regression3.cpp @@ -27,6 +27,7 @@ using json = nlohmann::json; using ordered_json = nlohmann::ordered_json; #include +#include #include #include #include @@ -60,6 +61,12 @@ using ordered_json = nlohmann::ordered_json; >; #endif +#ifdef JSON_HAS_CPP_20 + #if __has_include() + #include + #endif +#endif + #if JSON_HAS_RANGES == 1 #include #endif