From 334ca64683aec29d0be562576f63a5a1af9e3e1c Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 22 Oct 2026 13:39:52 +0200 Subject: [PATCH] Bind the parser test's strings by reference in the range-for loop GCC and Clang 14 (-Wrange-loop-construct) reported the copy. Signed-off-by: Niels Lohmann --- tests/src/unit-class_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/unit-class_parser.cpp b/tests/src/unit-class_parser.cpp index a97652243..079e80085 100644 --- a/tests/src/unit-class_parser.cpp +++ b/tests/src/unit-class_parser.cpp @@ -2970,7 +2970,7 @@ TEST_CASE("accept() agrees with parse() on floats around the overflow limit") for (const char* number : numbers) { - for (const std::string text : + for (const std::string& text : { std::string(number), "[" + std::string(number) + "]", "{\"a\":" + std::string(number) + "}" })