From f98402d9e6ccef7052eb01de418fd740f5f5e02f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 20 Oct 2010 01:01:57 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaLookup.cpp | 5 ++++- test/FixIt/typo.m | 3 --- 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; -- 2.40.0