[clang] [clang] Detect pointee mutations in placement new expressions (PR #187508)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 20 02:27:58 PDT 2026


================
@@ -1801,6 +1801,16 @@ TEST(ExprMutationAnalyzerTest, PointeeMutatedByPassAsArgument) {
         match(withEnclosingCompound(declRefTo("x")), AST->getASTContext());
     EXPECT_TRUE(isPointeeMutated(Results, AST.get()));
   }
+  {
+    const std::string Code =
+        "namespace std { typedef decltype(sizeof(int)) size_t; }"
----------------
vbvictor wrote:

Do we really need size_t define here? can we just use plain `unsigned int` or `int`?

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


More information about the cfe-commits mailing list