================
@@ -89,17 +167,80 @@ bool
VarBypassDetector::BuildScopeInformation(CodeGenModule &CGM, const Stmt *S,
// propagate out into the enclosing scope. Otherwise we have to worry about
// block literals, which have the lifetime of their enclosing statement.
unsigned independentParentScope = origParentScope;
- unsigned &ParentScope =
- ((isa<Expr>(S) && !isa<StmtExpr>(S)) ? origParentScope
- : independentParentScope);
+ unsigned &ParentScope = ((isa<Expr, AttributedStmt>(S) && !isa<StmtExpr>(S))
+ ? origParentScope
+ : independentParentScope);
+
+ unsigned PrevBlockScope = CurEnclosingBlockScope;
+ llvm::scope_exit RestoreBlock(
+ [&] { CurEnclosingBlockScope = PrevBlockScope; });
unsigned StmtsToSkip = 0u;
switch (S->getStmtClass()) {
----------------
efriedma-quic wrote:
Do we need to special-case lambdas?
https://github.com/llvm/llvm-project/pull/238919
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits