29 const auto *MatchedEscapingBlock =
30 Result.Nodes.getNodeAs<BlockExpr>(
"arg-block");
31 const BlockDecl *EscapingBlockDecl = MatchedEscapingBlock->getBlockDecl();
32 for (
const BlockDecl::Capture &CapturedVar : EscapingBlockDecl->captures()) {
33 const VarDecl *Var = CapturedVar.getVariable();
34 if (Var && Var->hasAttr<NoEscapeAttr>()) {
37 diag(MatchedEscapingBlock->getBeginLoc(),
38 "pointer %0 with attribute 'noescape' is captured by an "
39 "asynchronously-executed block")
41 diag(Var->getBeginLoc(),
"the 'noescape' attribute is declared here.",