[clang] [LifetimeSafety] Overhaul CFG and analysis to also work with trivially destructed temporary objects (PR #177985)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Sun Feb 15 10:21:37 PST 2026
================
@@ -0,0 +1,15 @@
+// RUN: %clang_analyze_cc1 -fcxx-exceptions -fexceptions -analyzer-checker=debug.DumpCFG -analyzer-config cfg-lifetime=true %s > %t 2>&1
+// RUN: FileCheck --input-file=%t %s
+
+struct TrivialDtor {};
+
+struct NonTrivialDtor {
+ ~NonTrivialDtor();
+};
+
+void foo(const TrivialDtor&, const NonTrivialDtor&);
+
+// CHECK: (FullExprCleanup collected 2 MTEs: [B1.4], [B1.8])
+void f() {
+ foo(TrivialDtor(), NonTrivialDtor());
+}
----------------
Xazax-hun wrote:
Nit: missing new line at the end of file.
https://github.com/llvm/llvm-project/pull/177985
More information about the cfe-commits
mailing list