diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-06-12 19:33:26 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-06-12 19:33:26 +0000 |
commit | fbfbaf6a931918f7a648758b0a709d52b30ed71b (patch) | |
tree | ca3d8e8a42f9ec308cb121e07fcf0620ac58ff1c | |
parent | 8730ee737517d11554eae525a8a78925ea94e7f4 (diff) | |
download | bcm5719-llvm-fbfbaf6a931918f7a648758b0a709d52b30ed71b.tar.gz bcm5719-llvm-fbfbaf6a931918f7a648758b0a709d52b30ed71b.zip |
Permit -Wswitch coverage for enumerations.
Thanks to David Blakie and Richard Smith for pointing out that we can retain the
-Wswitch coverage while avoiding the warning from GCC by pushing the unreachable
outside of the switch!
llvm-svn: 210812
-rw-r--r-- | clang/lib/Basic/DiagnosticIDs.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Format/Format.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Basic/DiagnosticIDs.cpp b/clang/lib/Basic/DiagnosticIDs.cpp index 0b3627eb1c0..6bc230a33ca 100644 --- a/clang/lib/Basic/DiagnosticIDs.cpp +++ b/clang/lib/Basic/DiagnosticIDs.cpp @@ -368,7 +368,6 @@ 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: @@ -380,6 +379,7 @@ static DiagnosticIDs::Level toLevel(diag::Severity SV) { case diag::Severity::Fatal: return DiagnosticIDs::Fatal; } + llvm_unreachable("unexpected severity"); } /// getDiagnosticLevel - Based on the way the client configured the diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index e1ec2517b48..913c6225ee6 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -272,7 +272,6 @@ 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: @@ -280,6 +279,7 @@ std::string ParseErrorCategory::message(int EV) const { case ParseError::Unsuitable: return "Unsuitable"; } + llvm_unreachable("unexpected parse error"); } FormatStyle getLLVMStyle() { |