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
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:
case diag::Severity::Fatal:
return DiagnosticIDs::Fatal;
}
+ llvm_unreachable("unexpected severity");
}
/// getDiagnosticLevel - Based on the way the client configured the
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:
case ParseError::Unsuitable:
return "Unsuitable";
}
+ llvm_unreachable("unexpected parse error");
}
FormatStyle getLLVMStyle() {