diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-14 04:54:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-14 04:54:23 +0000 |
commit | 5cf0e1534af401a4f8835defbfe92e168c4d56a6 (patch) | |
tree | e1ef625d6ce221e08fa10ffdd25a5d983a99d818 /clang/lib | |
parent | d5234bbced075ba5110ddba00567e15fb1ce0dcf (diff) | |
download | bcm5719-llvm-5cf0e1534af401a4f8835defbfe92e168c4d56a6.tar.gz bcm5719-llvm-5cf0e1534af401a4f8835defbfe92e168c4d56a6.zip |
Add a hackaround to avoid the crash in PR10355. However, our recovery
is still terrible here because typo correction is not behaving well in
the presence of overloaded functions.
llvm-svn: 135128
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index ebb1324dcd0..9d91a48bdcd 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -515,6 +515,7 @@ Corrected: // Perform typo correction to determine if there is another name that is // close to this name. if (!SecondTry) { + SecondTry = true; if (TypoCorrection Corrected = CorrectTypo(Result.getLookupNameInfo(), Result.getLookupKind(), S, &SS)) { unsigned UnqualifiedDiag = diag::err_undeclared_var_use_suggest; @@ -560,8 +561,9 @@ Corrected: if (Corrected.isKeyword()) return Corrected.getCorrectionAsIdentifierInfo(); - Diag(FirstDecl->getLocation(), diag::note_previous_decl) - << CorrectedQuotedStr; + if (FirstDecl) + Diag(FirstDecl->getLocation(), diag::note_previous_decl) + << CorrectedQuotedStr; // If we found an Objective-C instance variable, let // LookupInObjCMethod build the appropriate expression to |