From d2f657fb156f0c4e5173e79440e15d37dbeb99ae Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 12 Jun 2014 17:43:37 +0000 Subject: [PATCH] Basic: fix warnings from GCC MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit tools/clang/lib/Basic/DiagnosticIDs.cpp: In function ‘clang::DiagnosticIDs::Level toLevel(clang::diag::Severity)’: tools/clang/lib/Basic/DiagnosticIDs.cpp:382:1: warning: control reaches end of non-void function [-Wreturn-type] tools/clang/lib/Format/Format.cpp: In member function ‘virtual std::string clang::format::ParseErrorCategory::message(int) const’: tools/clang/lib/Format/Format.cpp:282:1: warning: control reaches end of non-void function [-Wreturn-type] Add a default cases that asserts that we handle the severity, parse error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210804 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/DiagnosticIDs.cpp | 1 + lib/Format/Format.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index 0bf4355770..0b3627eb1c 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -368,6 +368,7 @@ StringRef DiagnosticIDs::getDescription(unsigned DiagID) const { static DiagnosticIDs::Level toLevel(diag::Severity SV) { switch (SV) { + default: llvm_unreachable("unexpected severity"); case diag::Severity::Ignored: return DiagnosticIDs::Ignored; case diag::Severity::Remark: diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 176cb49df8..e1ec2517b4 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -272,6 +272,7 @@ const char *ParseErrorCategory::name() const LLVM_NOEXCEPT { std::string ParseErrorCategory::message(int EV) const { switch (static_cast(EV)) { + default: llvm_unreachable("unexpected parse error"); case ParseError::Success: return "Success"; case ParseError::Error: -- 2.40.0