riccibruno created this revision. riccibruno added a reviewer: hans. riccibruno added a project: clang. Herald added a subscriber: cfe-commits.
This is showing up with some bots (eg http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/19061/steps/build%20stage%201/logs/warnings%20%284%29) I am putting this for review since I am not familiar with this code and am not sure whether adding `llvm_unreachable` is better than adding a default case covering the invalid cases, as is done a few lines below. Repository: rC Clang https://reviews.llvm.org/D56006 Files: lib/AST/ScanfFormatString.cpp Index: lib/AST/ScanfFormatString.cpp =================================================================== --- lib/AST/ScanfFormatString.cpp +++ lib/AST/ScanfFormatString.cpp @@ -264,6 +264,7 @@ case LengthModifier::AsWide: return ArgType::Invalid(); } + llvm_unreachable("Unexpected length modifier!"); // Unsigned int. case ConversionSpecifier::oArg: @@ -303,6 +304,7 @@ case LengthModifier::AsWide: return ArgType::Invalid(); } + llvm_unreachable("Unexpected length modifier!"); // Float. case ConversionSpecifier::aArg:
Index: lib/AST/ScanfFormatString.cpp =================================================================== --- lib/AST/ScanfFormatString.cpp +++ lib/AST/ScanfFormatString.cpp @@ -264,6 +264,7 @@ case LengthModifier::AsWide: return ArgType::Invalid(); } + llvm_unreachable("Unexpected length modifier!"); // Unsigned int. case ConversionSpecifier::oArg: @@ -303,6 +304,7 @@ case LengthModifier::AsWide: return ArgType::Invalid(); } + llvm_unreachable("Unexpected length modifier!"); // Float. case ConversionSpecifier::aArg:
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits