From 2824823abba1f39d2de76eedb96ff922ee86cea8 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sun, 26 Jan 2014 08:12:32 +0000 Subject: [PATCH] Fix -Wreturn-type build failure on ASTMatchers, plus an intended assert git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200140 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ASTMatchers/Dynamic/Marshallers.h | 1 + lib/Basic/Diagnostic.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ASTMatchers/Dynamic/Marshallers.h b/lib/ASTMatchers/Dynamic/Marshallers.h index db5d30f870..277224a39e 100644 --- a/lib/ASTMatchers/Dynamic/Marshallers.h +++ b/lib/ASTMatchers/Dynamic/Marshallers.h @@ -54,6 +54,7 @@ struct ArgKind { case AK_String: return "string"; } + llvm_unreachable("unhandled ArgKind"); } Kind getArgKind() const { return K; } diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 9bb7478dff..f50754830f 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -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); -- 2.40.0