[clang] [analyzer] Suppress NewDeleteLeaks FP in protobuf code (PR #162124)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 7 03:57:50 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"
----------------
NagyDonat wrote:
Ok, I moved the include to the top. (I didn't want to create a separate test file because I feel that it would be too small.)
https://github.com/llvm/llvm-project/pull/162124
More information about the cfe-commits
mailing list