Silence -Wweak-vtables for the SAX event loggers

The loggers moved from anonymous namespaces in the test files into
sax_event_loggers.hpp, so clang now warns that their vtables are
emitted in every translation unit.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-08 16:14:00 +02:00
1 parent a7ae5d748e
commit d974c4a64f
1 file changed
+11
+11
View File
@@ -16,6 +16,13 @@
#include <nlohmann/json.hpp>
// the loggers are defined in this header only, so their vtables are emitted in
// every test that includes it
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
namespace utils
{
/// a SAX event consumer that records every event it receives as a
@@ -172,3 +179,7 @@ struct SaxEventLoggerExitAfterStartArray : public SaxEventLogger
}
};
} // namespace utils
#if defined(__clang__)
#pragma clang diagnostic pop
#endif