From 01ad4ae72b375ffd6ee1a44240c7a55498ccef8b Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Sat, 13 Dec 2014 02:54:28 +0000 Subject: 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 --- clang/lib/Sema/SemaExprCXX.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaExprCXX.cpp') 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(); -- cgit v1.2.3