From 98848ba230fe60eecb7b3d051d912caa09191db1 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 24 Sep 2026 09:38:18 +0200 Subject: [PATCH] Test for EMPTY and MEMBERS so -Wunused-macros accepts them Signed-off-by: Niels Lohmann --- tests/src/unit-udt_macro.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/src/unit-udt_macro.cpp b/tests/src/unit-udt_macro.cpp index 4f9533f5e..ff254b60e 100644 --- a/tests/src/unit-udt_macro.cpp +++ b/tests/src/unit-udt_macro.cpp @@ -958,6 +958,10 @@ class dispatch_with_user_macros_derived_members : public dispatch_with_user_macr // NOLINTNEXTLINE(misc-use-internal-linkage) NLOHMANN_DEFINE_DERIVED_TYPE_NON_INTRUSIVE(dispatch_with_user_macros_derived_members, dispatch_with_user_macros_members, own) +// testing for the macros also keeps -Wunused-macros from rejecting them +#if !defined(EMPTY) || !defined(MEMBERS) + #error "EMPTY and MEMBERS must stay defined for the tests above" +#endif #undef EMPTY #undef MEMBERS