aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-06-12 17:43:37 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-06-12 17:43:37 +0000
commitc9340d2575b26302b5598c5f1ac474338d99f9a2 (patch)
tree71badbadff0151ac9e20c0aa172b6618735efca3
parenta6e9c3e43ae125530b7d9f158f5486ac48ca5a29 (diff)
downloadllvm-c9340d2575b26302b5598c5f1ac474338d99f9a2.zip
llvm-c9340d2575b26302b5598c5f1ac474338d99f9a2.tar.gz
llvm-c9340d2575b26302b5598c5f1ac474338d99f9a2.tar.bz2
Basic: fix warnings from GCC
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. llvm-svn: 210804
-rw-r--r--clang/lib/Basic/DiagnosticIDs.cpp1
-rw-r--r--clang/lib/Format/Format.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp
index 0bf43557..0b3627e 100644
--- a/clang/lib/Basic/DiagnosticIDs.cpp
+++ b/clang/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/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 176cb49..e1ec251 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/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<ParseError>(EV)) {
+ default: llvm_unreachable("unexpected parse error");
case ParseError::Success:
return "Success";
case ParseError::Error: