From 071f79b524d4f8882ad982f3c05034a300c84580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Afonso=20Janu=C3=A1rio?= Date: Sun, 30 Aug 2026 18:51:03 +0100 Subject: [PATCH] Mark the unordered_set in the hash regression test const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clang-tidy's misc-const-correctness check flagged it: the set is never mutated after construction, only read via size(). Signed-off-by: Afonso Januário Signed-off-by: Niels Lohmann --- tests/src/unit-hash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/unit-hash.cpp b/tests/src/unit-hash.cpp index a517291a8..1d4fde81d 100644 --- a/tests/src/unit-hash.cpp +++ b/tests/src/unit-hash.cpp @@ -145,7 +145,7 @@ TEST_CASE("hash") CHECK(std::hash {}(json(-1)) == std::hash {}(json(-1.0))); // a std::unordered_set relies on this same consistency between == and hash - std::unordered_set numbers {json(0), json(static_cast(0)), json(0.0)}; + const std::unordered_set numbers {json(0), json(static_cast(0)), json(0.0)}; CHECK(numbers.size() == 1); }