nridge added a comment.

In D115187#3471261 <https://reviews.llvm.org/D115187#3471261>, @sammccall wrote:

> We're not supposed to <https://eel.is/c++draft/expr.await#3.2> transform 
> initial/final suspends, but the code is now doing so.
>
> This seems to be a consequence of switching from BuildResolvedCoawaitExpr 
> (which does not apply the transform) to BuildUnresolvedCoawaitExpr (which 
> does) during template instantiation.

Thanks, this helped me get onto the right track for a fix.

Indeed, we have two different codepaths by which `CoawaitExpr`s are built: 
explicit ones use `BuildUnresolvedCoawaitExpr`, while the implicit ones for the 
suspends use `BuildResolvedCoawaitExpr` with a bit of extra logic before (to 
apply `operator coawait` (but not `await_transform`) if appropriate).

Thankfully, `CoawaitExpr` remembers which kind it is in `isImplicit()`, so it's 
straightforward to get `TreeTransform` to do the right thing based on this flag.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115187

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

Reply via email to