rjmccall added inline comments.

================
Comment at: clang/lib/Parse/ParseExpr.cpp:1009
+              Actions, Sema::ExpressionEvaluationContext::Unevaluated,
+              Sema::ReuseLambdaContextDecl);
+          Res = Actions.TransformToPotentiallyEvaluated(Res.get());
----------------
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`.


================
Comment at: clang/lib/Parse/ParseTentative.cpp:1279
+      // Enter unevaluated context to prevent propagation of the odr-use data 
to
+      // outer context in case of unsuccesful tentative parsing.
+      EnterExpressionEvaluationContext Unevaluated(
----------------
Suggestion:

```
// Tentative parsing may not be done in the right evaluation context
// for the ultimate expression.  Enter an unevaluated context to prevent
// Sema from immediately e.g. treating this lookup as a potential ODR-use.
// If we generate an expression annotation token and the parser actually
// claims it as an expression, we'll transform the expression to a
// potentially-evaluated one then.
```


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