From c0ae88bf50a4bf45458dc6c8cca633eb9c368727 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 5 Nov 2019 20:23:17 +0100 Subject: [PATCH] :rotating_light: fix linter errors --- test/src/unit-regression.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/src/unit-regression.cpp b/test/src/unit-regression.cpp index 6b2e94a1..c3ae5771 100644 --- a/test/src/unit-regression.cpp +++ b/test/src/unit-regression.cpp @@ -166,7 +166,7 @@ namespace { struct NonDefaultFromJsonStruct { }; -inline bool operator== (NonDefaultFromJsonStruct const& lhs, NonDefaultFromJsonStruct const& rhs) +inline bool operator== (NonDefaultFromJsonStruct const&, NonDefaultFromJsonStruct const&) { return true; } @@ -185,7 +185,7 @@ namespace nlohmann template <> struct adl_serializer { - static NonDefaultFromJsonStruct from_json (json const& j) + static NonDefaultFromJsonStruct from_json (json const&) { return {}; } @@ -1872,8 +1872,16 @@ TEST_CASE("regression tests") SECTION("issue #1647 - compile error when deserializing enum if both non-default from_json and non-member operator== exists for other type") { + { + json j; + NonDefaultFromJsonStruct x = j; + NonDefaultFromJsonStruct y; + CHECK(x == y); + } + auto val = nlohmann::json("one").get(); CHECK(val == for_1647::one); + json j = val; } SECTION("issue #1805 - A pair is json constructible only if T1 and T2 are json constructible")