aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM! Thank you for the fix!



================
Comment at: clang/lib/Sema/SemaExpr.cpp:16575-16578
+      ExprEvalContexts[ExprEvalContexts.size() - 2]
+          .isDiscardedStatementContext();
+  ExprEvalContexts.back().InImmediateFunctionContext =
+      ExprEvalContexts[ExprEvalContexts.size() - 2]
----------------
cor3ntin wrote:
> aaron.ballman wrote:
> > It took me a moment to understand why `-2` was happening here. However, 
> > isn't this going to be UB when we go to push the first expr evaluation 
> > context?
> No, there is always one root context created during initialization of sema. 
> Because this pattern is used in a few places, I did not add a comment.
Ah, good to know, thank you!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113749/new/

https://reviews.llvm.org/D113749

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to