Fix develop CI: GCC 4.8, Clang 3.4 and clang-tidy errors

- unit-json_patch.cpp: move multi-line raw strings out of CHECK(), which
  GCC 4.8 cannot parse inside a macro argument
- unit-recursion_depth_limit.cpp: value-initialize the const std::hash
  (Clang 3.4 rejects default initialization of a const object)
- json_view: silence modernize-use-transparent-functors (std::less<> is
  C++14), bugprone-suspicious-stringview-data-usage (the length comes from
  the node) and the deliberate use-after-clear() / owning-memory hits in
  unit-json_view_builder.cpp; use a raw string literal there

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-11-12 12:15:54 +01:00
1 parent cdfb130fa6
commit 15348ea128
6 files changed
+22 -12

No files matched your search

+1 -1
View File
@@ -494,7 +494,7 @@ TEST_CASE("walks over values nested around the recursion depth limit")
for_each_value([](const std::string & kinds)
{
const json a = build(kinds, 1);
const std::hash<json> hash;
const std::hash<json> hash{};
CHECK(hash(a) == hash(json(a)));
CHECK(hash(a) == hash(json::parse(expected_compact(kinds, "1"))));
CHECK(hash(a) != hash(build(kinds, 2)));