diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2014-12-13 02:54:28 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2014-12-13 02:54:28 +0000 |
commit | 01ad4ae72b375ffd6ee1a44240c7a55498ccef8b (patch) | |
tree | ef6d4254ad8db0fe9f003edf343be1329440b2e6 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 035b964d728f8ea973c08603597051c50333cc99 (diff) | |
download | bcm5719-llvm-01ad4ae72b375ffd6ee1a44240c7a55498ccef8b.tar.gz bcm5719-llvm-01ad4ae72b375ffd6ee1a44240c7a55498ccef8b.zip |
Fix two small bugs in typo correction. One assertion failure building member expressions because the lookup finds a different name than the original, fixed by updating the LookupResult's name with the name of the found decl. Second is that we also diagnose delayed typo exprs in the index of an array subscript expression.
The testcase shows a third bug with a FIXME in it.
llvm-svn: 224183
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index ad376f12542..1f9c1ea73cd 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -5961,9 +5961,10 @@ static ExprResult attemptRecovery(Sema &SemaRef, NewSS = *SS; if (auto *ND = TC.getCorrectionDecl()) { + R.setLookupName(ND->getDeclName()); R.addDecl(ND); if (ND->isCXXClassMember()) { - // Figure out the correct naming class to ad to the LookupResult. + // Figure out the correct naming class to add to the LookupResult. CXXRecordDecl *Record = nullptr; if (auto *NNS = TC.getCorrectionSpecifier()) Record = NNS->getAsType()->getAsCXXRecordDecl(); |