r189571 - Change return type of Sema::DiagnoseAmbiguousLookup from bool to void.

Serge Pavlov sepavloff at gmail.com
Thu Aug 29 00:23:24 PDT 2013


Author: sepavloff
Date: Thu Aug 29 02:23:24 2013
New Revision: 189571

URL: http://llvm.org/viewvc/llvm-project?rev=189571&view=rev
Log:
Change return type of Sema::DiagnoseAmbiguousLookup from bool to void.
The function always returned true value, which was never used.

Modified:
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaLookup.cpp

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=189571&r1=189570&r2=189571&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Thu Aug 29 02:23:24 2013
@@ -2504,7 +2504,7 @@ public:
                             bool ConsiderLinkage,
                             bool ExplicitInstantiationOrSpecialization);
 
-  bool DiagnoseAmbiguousLookup(LookupResult &Result);
+  void DiagnoseAmbiguousLookup(LookupResult &Result);
   //@}
 
   ObjCInterfaceDecl *getObjCInterfaceDecl(IdentifierInfo *&Id,

Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=189571&r1=189570&r2=189571&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Thu Aug 29 02:23:24 2013
@@ -1796,9 +1796,7 @@ bool Sema::LookupParsedName(LookupResult
 /// 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(Looku
       ++Found;
 
     Diag((*Found)->getLocation(), diag::note_ambiguous_member_found);
-
-    return true;
+    break;
   }
 
   case LookupResult::AmbiguousBaseSubobjectTypes: {
@@ -1836,8 +1833,7 @@ bool Sema::DiagnoseAmbiguousLookup(Looku
       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(Looku
         F.erase();
     }
     F.done();
-
-    return true;
+    break;
   }
 
   case LookupResult::AmbiguousReference: {
@@ -1873,12 +1868,12 @@ bool Sema::DiagnoseAmbiguousLookup(Looku
     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 {





More information about the cfe-commits mailing list