[clang] [LifetimeSafety] Verify lifetime_capture_by(X) against the body (PR #207346)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 14 07:58:29 PST 2026
================
@@ -0,0 +1,154 @@
+// RUN: %clang_cc1 -fsyntax-only -Wlifetime-safety-capture-by-violation -verify %s
+// RUN: %clang_cc1 -fsyntax-only -Wlifetime-safety-annotation-verification -verify=expected,verification %s
+
+#include "Inputs/lifetime-analysis.h"
+
+struct Cap { const int *p; };
+const int *global; // #global
----------------
NeKon69 wrote:
I remember Utkarsh mentioning that he wasn't a fan of using these labels in tests. I'm fine with them, but I wonder if his opinion has changed since then.
https://github.com/llvm/llvm-project/pull/207346
More information about the cfe-commits
mailing list