From 55a12ee212a06205ab8f38f9d71d3c98d8ce5fa9 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 11 Jul 2026 18:47:33 +0200 Subject: [PATCH] Fix -Wctad-maybe-unsupported in counted_iterator test std::counted_iterator's constructor deduction guide isn't guaranteed to be intentionally supported by every standard library, so clang's -Weverything flags implicit CTAD on it. Use an explicit template argument instead, matching how the rest of the test suite avoids CTAD on standard library types under strict warning flags. Signed-off-by: Niels Lohmann --- tests/src/unit-user_defined_input.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/src/unit-user_defined_input.cpp b/tests/src/unit-user_defined_input.cpp index f9485fcf7..6dd6100e0 100644 --- a/tests/src/unit-user_defined_input.cpp +++ b/tests/src/unit-user_defined_input.cpp @@ -216,15 +216,16 @@ TEST_CASE("Parse with heterogeneous iterator and sentinel types") // JSON_HAS_CPP_20 (do not remove; see note at top of file) TEST_CASE("Parse with std::counted_iterator and std::default_sentinel_t") { + using iterator_type = std::string::const_iterator; const std::string json_str = R"({"key":"value","array":[1,2,3]})"; - const auto len = static_cast>(json_str.size()); + const auto len = static_cast>(json_str.size()); - std::counted_iterator first(json_str.begin(), len); + std::counted_iterator first(json_str.begin(), len); const json j = json::parse(first, std::default_sentinel); CHECK(j["key"] == "value"); CHECK(j["array"].size() == 3); - std::counted_iterator first2(json_str.begin(), len); + std::counted_iterator first2(json_str.begin(), len); CHECK(json::accept(first2, std::default_sentinel)); } #endif