[clang] [analyzer] Suppress NewDeleteLeaks FP in protobuf code (PR #162124)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 6 21:51:52 PDT 2025
================
@@ -218,3 +218,37 @@ void caller() {
(void)n;
} // no-warning: No potential memory leak here, because that's been already reported.
} // namespace symbol_reaper_lifetime
+
+// Check that we do not report false positives in automaticall generated
+// protobuf code that passes dynamically allocated memory to a certain function
+// named GetOwnedMessageInternal.
+namespace protobuf_leak {
+#include "Inputs/system-header-simulator-for-protobuf.h"
----------------
steakhal wrote:
I'd just include this at the top, or create a separate test file.
Including into a namespace is pretty evil.
https://github.com/llvm/llvm-project/pull/162124
More information about the cfe-commits
mailing list