]> granicus.if.org Git - clang/commitdiff
Fix -Wreturn-type build failure on ASTMatchers, plus an intended assert
authorAlp Toker <alp@nuanti.com>
Sun, 26 Jan 2014 08:12:32 +0000 (08:12 +0000)
committerAlp Toker <alp@nuanti.com>
Sun, 26 Jan 2014 08:12:32 +0000 (08:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200140 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ASTMatchers/Dynamic/Marshallers.h
lib/Basic/Diagnostic.cpp

index db5d30f87005d621b850d34d71c017158316b37b..277224a39e4abb02ee1593d235bdcfea0248d69f 100644 (file)
@@ -54,6 +54,7 @@ struct ArgKind {
     case AK_String:
       return "string";
     }
+    llvm_unreachable("unhandled ArgKind");
   }
 
   Kind getArgKind() const { return K; }
index 9bb7478dff9ec128e54f4024b09f5fb924fbf3ad..f50754830fd75f7bb8ddb529056cda0437bb22c2 100644 (file)
@@ -222,7 +222,7 @@ void DiagnosticsEngine::setDiagnosticMapping(diag::kind Diag, diag::Mapping Map,
 
   // Create a new state/point and fit it into the vector of DiagStatePoints
   // so that the vector is always ordered according to location.
-  Pos->Loc.isBeforeInTranslationUnitThan(Loc);
+  assert(Pos->Loc.isBeforeInTranslationUnitThan(Loc));
   DiagStates.push_back(*Pos->State);
   DiagState *NewState = &DiagStates.back();
   GetCurDiagState()->setMappingInfo(Diag, MappingInfo);