From ebf5a176c4c1bcc9356ee62d2bb02bcde0814eaf Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 27 Oct 2026 14:31:31 +0100 Subject: [PATCH] Fix remaining red CI on develop: Infer null dereferences, clang-tidy redundant init (#5943) --- tests/src/unit-bson.cpp | 2 +- tests/src/unit-pointer_access.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/src/unit-bson.cpp b/tests/src/unit-bson.cpp index 73b277d56..b4756c9b5 100644 --- a/tests/src/unit-bson.cpp +++ b/tests/src/unit-bson.cpp @@ -1311,7 +1311,7 @@ TEST_CASE("BSON declared document size bounds the content") // records the events that a SAX parser receives struct recorder : nlohmann::json_sax { - std::string events{}; + std::string events; bool null() override { diff --git a/tests/src/unit-pointer_access.cpp b/tests/src/unit-pointer_access.cpp index 2b84ceede..08b331b3a 100644 --- a/tests/src/unit-pointer_access.cpp +++ b/tests/src/unit-pointer_access.cpp @@ -291,6 +291,7 @@ TEST_CASE("pointer access") // check if pointers are returned correctly test_type* p1 = value.get_ptr(); CHECK(p1 == value.get_ptr()); + // @infer-ignore NULLPTR_DEREFERENCE CHECK(*p1 == value.get()); const test_type* p2 = value.get_ptr(); @@ -320,6 +321,7 @@ TEST_CASE("pointer access") // check if pointers are returned correctly const test_type* p1 = value.get_ptr(); CHECK(p1 == value.get_ptr()); + // @infer-ignore NULLPTR_DEREFERENCE CHECK(*p1 == value.get()); const test_type* p2 = value.get_ptr(); @@ -349,6 +351,7 @@ TEST_CASE("pointer access") // check if pointers are returned correctly test_type* p1 = value.get_ptr(); CHECK(p1 == value.get_ptr()); + // @infer-ignore NULLPTR_DEREFERENCE CHECK(*p1 == value.get()); const test_type* p2 = value.get_ptr(); @@ -378,6 +381,7 @@ TEST_CASE("pointer access") // check if pointers are returned correctly const test_type* p1 = value.get_ptr(); CHECK(p1 == value.get_ptr()); + // @infer-ignore NULLPTR_DEREFERENCE CHECK(*p1 == Approx(value.get())); const test_type* p2 = value.get_ptr(); @@ -407,6 +411,7 @@ TEST_CASE("pointer access") // check if pointers are returned correctly test_type* p1 = value.get_ptr(); CHECK(p1 == value.get_ptr()); + // @infer-ignore NULLPTR_DEREFERENCE CHECK(*p1 == Approx(value.get())); const test_type* p2 = value.get_ptr();