]> granicus.if.org Git - clang/commitdiff
Eliminate another ordering dependency in typo correction. Re-enable typo.m, which...
authorDouglas Gregor <dgregor@apple.com>
Wed, 20 Oct 2010 01:01:57 +0000 (01:01 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 20 Oct 2010 01:01:57 +0000 (01:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116894 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp
test/FixIt/typo.m

index 060274e0d8a584ddc99566708c64aa1a25061cbb..ab810a4682a3671d725a5f7b37253d41591a0882 100644 (file)
@@ -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();
index 0be21a0fe2e3ed22476370ad3cedcdf670cef5ee..b8c57e46e3b89bbf46e6165a0d1d09f7b6ed0024 100644 (file)
@@ -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;