]> granicus.if.org Git - clang/commitdiff
Change return type of Sema::DiagnoseAmbiguousLookup from bool to void.
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 29 Aug 2013 07:23:24 +0000 (07:23 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Thu, 29 Aug 2013 07:23:24 +0000 (07:23 +0000)
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
lib/Sema/SemaLookup.cpp

index debcba77f644bb67a9bd69a95b3b0ef35ade434d..cc8535ae303a2dd2309852770492ee7a3b2f3340 100644 (file)
@@ -2504,7 +2504,7 @@ public:
                             bool ConsiderLinkage,
                             bool ExplicitInstantiationOrSpecialization);
 
-  bool DiagnoseAmbiguousLookup(LookupResult &Result);
+  void DiagnoseAmbiguousLookup(LookupResult &Result);
   //@}
 
   ObjCInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *&Id,
index c00ae69cbe87d043b21492405c2d7efed43abfc6..d352ed8cccab22f881d491d93c3e07a028032ef1 100644 (file)
@@ -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 {