From 8ed2f3ad9505962d8dec4630caeaad607edbbb7d Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 29 Aug 2013 07:23:24 +0000 Subject: [PATCH] Change return type of Sema::DiagnoseAmbiguousLookup from bool to void. The function always returned true value, which was never used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189571 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Sema/Sema.h | 2 +- lib/Sema/SemaLookup.cpp | 21 ++++++++------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index debcba77f6..cc8535ae30 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -2504,7 +2504,7 @@ public: bool ConsiderLinkage, bool ExplicitInstantiationOrSpecialization); - bool DiagnoseAmbiguousLookup(LookupResult &Result); + void DiagnoseAmbiguousLookup(LookupResult &Result); //@} ObjCInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *&Id, diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index c00ae69cbe..d352ed8ccc 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1796,9 +1796,7 @@ bool Sema::LookupParsedName(LookupResult &R, Scope *S, CXXScopeSpec *SS, /// from name lookup. /// /// \param Result The result of the ambiguous lookup to be diagnosed. -/// -/// \returns true -bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result) { +void Sema::DiagnoseAmbiguousLookup(LookupResult &Result) { assert(Result.isAmbiguous() && "Lookup result must be ambiguous"); DeclarationName Name = Result.getLookupName(); @@ -1819,8 +1817,7 @@ bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result) { ++Found; Diag((*Found)->getLocation(), diag::note_ambiguous_member_found); - - return true; + break; } case LookupResult::AmbiguousBaseSubobjectTypes: { @@ -1836,8 +1833,7 @@ bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result) { if (DeclsPrinted.insert(D).second) Diag(D->getLocation(), diag::note_ambiguous_member_found); } - - return true; + break; } case LookupResult::AmbiguousTagHiding: { @@ -1863,8 +1859,7 @@ bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result) { F.erase(); } F.done(); - - return true; + break; } case LookupResult::AmbiguousReference: { @@ -1873,12 +1868,12 @@ bool Sema::DiagnoseAmbiguousLookup(LookupResult &Result) { LookupResult::iterator DI = Result.begin(), DE = Result.end(); for (; DI != DE; ++DI) Diag((*DI)->getLocation(), diag::note_ambiguous_candidate) << *DI; - - return true; - } + break; } - llvm_unreachable("unknown ambiguity kind"); + default: + llvm_unreachable("unknown ambiguity kind"); + } } namespace { -- 2.50.1