aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-20 01:01:57 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-20 01:01:57 +0000
commitf98402d9e6ccef7052eb01de418fd740f5f5e02f (patch)
tree21a8599ce16b76e84cad4fd17a371dbf0daae9a0
parentc87fa06caeaec2d6cb9772a187708a8bf6cf187c (diff)
Eliminate another ordering dependency in typo correction. Re-enable typo.m, which seems to be working properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116894 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaLookup.cpp5
-rw-r--r--test/FixIt/typo.m3
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 060274e0d8..ab810a4682 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -3138,7 +3138,10 @@ DeclarationName Sema::CorrectTypo(LookupResult &Res, Scope *S, CXXScopeSpec *SS,
// If only a single name remains, return that result.
if (Consumer.size() == 1) {
IdentifierInfo *Name = &Context.Idents.get(Consumer.begin()->getKey());
- if (!LastLookupWasAccepted) {
+ if (Consumer.begin()->second) {
+ Res.suppressDiagnostics();
+ Res.clear();
+ } else if (!LastLookupWasAccepted) {
// Perform name lookup on this name.
Res.suppressDiagnostics();
Res.clear();
diff --git a/test/FixIt/typo.m b/test/FixIt/typo.m
index 0be21a0fe2..b8c57e46e3 100644
--- a/test/FixIt/typo.m
+++ b/test/FixIt/typo.m
@@ -2,9 +2,6 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -x objective-c -E -P %s -o %t
// RUN: %clang_cc1 -x objective-c -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fixit %t || true
// RUN: %clang_cc1 -x objective-c -fsyntax-only -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -pedantic -Werror %t
-//
-// FIXME: Disabled while we investigate failure.
-// REQUIRES: disabled
@interface NSString // expected-note{{'NSString' declared here}}
+ (int)method:(int)x;