ABataev marked an inline comment as done.
ABataev added inline comments.

================
Comment at: clang/lib/Parse/ParseExpr.cpp:1009
+              Actions, Sema::ExpressionEvaluationContext::Unevaluated,
+              Sema::ReuseLambdaContextDecl);
+          Res = Actions.TransformToPotentiallyEvaluated(Res.get());
----------------
rjmccall wrote:
> Pushing an unevaluated context here isn't correct.  Here we're parsing the 
> expression for real and should already be in the right context for 
> `TransformToPotentiallyEvaluated`.
`TransformToPotentiallyEvaluated` expects that the innermost context is 
reevaluated. By the time we approach this branch, we're already out of the 
original unevaluated context. So, we need to create fake unevaluated context to 
mimic the original one. Function `TransformToPotentiallyEvaluated` copies the 
context state from the previous context to this new one and rebuilds the 
expression correctly. Instead, I can add a new function that transforms the 
expression in the current context and use it in 
`TransformToPotentiallyEvaluated`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80925



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

Reply via email to