Mark the parse callback in the new test noexcept

GCC's -Wnoexcept (part of the ci_test_gcc warning set) rejects the
lambda passed to parse() because it cannot throw but is not declared
noexcept, matching the existing callback in unit-regression2.cpp.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Niels Lohmann
2026-09-13 20:42:45 +02:00
co-authored by Claude Opus 5
parent ee211df64a
commit e7cca81d9a
+1 -1
View File
@@ -913,7 +913,7 @@ TEST_CASE("regression test #5476 - array type without reserve()")
CHECK(deque_json::from_msgpack(deque_json::to_msgpack(j)) == j);
// parse() instantiates the callback parser as well, which reserves too
const auto with_callback = deque_json::parse(R"([1,2,3])", [](int /*depth*/, deque_json::parse_event_t /*event*/, deque_json& /*parsed*/)
const auto with_callback = deque_json::parse(R"([1,2,3])", [](int /*depth*/, deque_json::parse_event_t /*event*/, deque_json& /*parsed*/) noexcept
{
return true;
});