summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCoroutine.cpp
diff options
context:
space:
mode:
authorGor Nishanov <GorNishanov@gmail.com>2018-03-27 20:38:19 +0000
committerGor Nishanov <GorNishanov@gmail.com>2018-03-27 20:38:19 +0000
commitbc15147a08b852975492811a1955a349c969c295 (patch)
tree448ee45c7edb816858215dfb62255a1f027619b9 /lib/Sema/SemaCoroutine.cpp
parentda20e3ce6c7a8d594349575657a08ed488897582 (diff)
downloadclang-bc15147a08b852975492811a1955a349c969c295.tar.gz
[coroutines] Do not attempt to typo-correct when coroutine is looking for required members
When SemaCoroutine looks for await_resume, it means it. No need for helpful: "Did you mean await_ready?" messages. Fixes PR33477 and a couple of FIXMEs in test/SemaCXX/coroutines.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCoroutine.cpp')
-rw-r--r--lib/Sema/SemaCoroutine.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaCoroutine.cpp b/lib/Sema/SemaCoroutine.cpp
index 95758baff4..139a21014d 100644
--- a/lib/Sema/SemaCoroutine.cpp
+++ b/lib/Sema/SemaCoroutine.cpp
@@ -362,6 +362,15 @@ static ExprResult buildMemberCall(Sema &S, Expr *Base, SourceLocation Loc,
if (Result.isInvalid())
return ExprError();
+ // We meant exactly what we asked for. No need for typo correction.
+ if (auto *TE = dyn_cast<TypoExpr>(Result.get())) {
+ S.clearDelayedTypo(TE);
+ S.Diag(Loc, diag::err_no_member)
+ << NameInfo.getName() << Base->getType()->getAsCXXRecordDecl()
+ << Base->getSourceRange();
+ return ExprError();
+ }
+
return S.ActOnCallExpr(nullptr, Result.get(), Loc, Args, Loc, nullptr);
}