[clang] [clang][Sema] Deprecate `global`/`unknown` in `lifetime_capture_by` (PR #196635)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 11 06:07:01 PDT 2026


================
@@ -4426,6 +4450,17 @@ LifetimeCaptureByAttr *Sema::ParseLifetimeCaptureByAttr(const ParsedAttr &AL,
     }
     assert(AL.isArgIdent(I));
     IdentifierLoc *IdLoc = AL.getArgAsIdent(I);
+    StringRef Name = IdLoc->getIdentifierInfo()->getName();
----------------
AaronBallman wrote:

You can use `IdentifierInfo::isStr()` instead of getting the name as a string, then pass the `IdentifierInfo *` into the call to `Diag` and it will be quoted properly in the diagnostic text.

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


More information about the cfe-commits mailing list