[clang] [analyzer] Fix FP for cplusplus.placement new #149240 (PR #150161)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 25 01:49:43 PDT 2025


================
@@ -0,0 +1,24 @@
+// RUN: %clang -fsyntax-only -Xclang -analyze -Xclang -analyzer-checker=cplusplus.PlacementNew -Xclang -verify -std=c++17 %s
+
+#include <new>
----------------
NagyDonat wrote:

These tests do not include real system headers (if I understand correctly, this is because the exact content of the system header could vary between different environments). Tests that validate the analysis of language/library features that are declared in system headers usually include "system header simulator" header files that are known to be consistent between environments and declare the relevant parts of the STL.

For example `placement-new.cpp` (the other test file that you edit) uses `"Inputs/system-header-simulator-cxx.h"`, I'd guess that it would be the good choice for this file as well.

https://github.com/llvm/llvm-project/pull/150161


More information about the cfe-commits mailing list