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

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 7 10:17:01 PST 2024


================
@@ -45,10 +48,14 @@ enum LifetimeKind {
   /// a default member initializer), the program is ill-formed.
   LK_MemInitializer,
 
-  /// The lifetime of a temporary bound to this entity probably ends too soon,
+  /// The lifetime of a temporary bound to this entity may end too soon,
   /// because the entity is a pointer and we assign the address of a temporary
   /// object to it.
   LK_Assignment,
+
+  /// The lifetime of a temporary bound to this entity may end too soon,
----------------
Xazax-hun wrote:

Probably out of scope for this PR, but are these comments up to date given that we can also warn when the address of a local escapes the function (as opposed to just temporaries)?

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


More information about the cfe-commits mailing list