From f5c49c8532e078faf3b049dde2066181d6337bbe Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 21 Jul 2022 15:09:01 +0200 Subject: [PATCH] :rotating_light: suppress UBSAN warning --- tests/src/unit-deserialization.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/src/unit-deserialization.cpp b/tests/src/unit-deserialization.cpp index 9454092d9..c61c6c635 100644 --- a/tests/src/unit-deserialization.cpp +++ b/tests/src/unit-deserialization.cpp @@ -170,6 +170,11 @@ struct SaxEventLoggerExitAfterStartArray : public SaxEventLogger // To still test whether exceptions are thrown, we need to exclude these tests from UBSAN which can only // be done with a function attribute. See // https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#disabling-instrumentation-with-attribute-no-sanitize-undefined +#if defined(__clang__) + __attribute__((no_sanitize("undefined"))) +#endif +void test_file_exception(); + #if defined(__clang__) __attribute__((no_sanitize("undefined"))) #endif