[PATCH] D115187: [clangd] Expose CoawaitExpr's operand in the AST
Nathan Ridge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 2 01:43:19 PDT 2022
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
More information about the cfe-commits
mailing list