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
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:
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: