[clang] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

Boaz Brickner via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 08:36:50 PST 2024


================
@@ -793,3 +806,202 @@ void test13() {
 }
 
 } // namespace GH100526
+
+namespace lifetime_capture_by {
+struct S {
+  const int *x;
+  void captureInt(const int&x [[clang::lifetime_capture_by(this)]]) { this->x = &x; }
----------------
bricknerb wrote:

Be consistent regarding spacing around &.

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


More information about the cfe-commits mailing list