[PATCH] D80109: [AST][RecoveryExpr] Preserve type for broken member call expr.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 30 00:01:44 PST 2020


hokein marked 2 inline comments as done.
hokein added a comment.

sorry for the delay, picking it up now.



================
Comment at: clang/lib/Sema/SemaCoroutine.cpp:864
     ExprResult R = buildPromiseCall(*this, Promise, Loc, "await_transform", E);
-    if (R.isInvalid()) {
+    if (R.isInvalid() || R.get()->containsErrors()) {
       Diag(Loc,
----------------
we need this change to prevent a regression on co_await-range-for.

without this change, we will emit 2 `call to deleted member function 'await_transform'` diagnostics  on https://github.com/llvm/llvm-project/blob/master/clang/test/SemaCXX/co_await-range-for.cpp#L52-L54.


================
Comment at: clang/test/AST/ast-dump-recovery.cpp:123
+
+  // FIXME: capture the type!
+  f.func(1);
----------------
sammccall wrote:
> why does this not work?
> isn't there only one candidate, so chooseRecoveryType should pick it?
this is on a different codepath, will fix in https://reviews.llvm.org/D92298


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80109



More information about the cfe-commits mailing list