[clang] [clang] Introduce [[clang::lifetime_capture_by(X)]] (PR #111499)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 11 02:44:55 PST 2024


================
@@ -1199,6 +1213,17 @@ static void checkExprLifetimeImpl(Sema &SemaRef,
       break;
     }
 
+    case LK_LifetimeCapture: {
+      if (!MTE)
----------------
Xazax-hun wrote:

Ah, makes sense. I guess there is only one case when we could potentially get away with this, when `addToSet` is the last operation in the function, i.e., it is a tail call. But we might not have a convenient way to tell that only based on the AST. 

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


More information about the cfe-commits mailing list