start checking case values of switch stmts more closely. Emit overflow
warnings when converting case values to the expression type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41313 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/Sema.h b/Sema/Sema.h
index 5056335..99bb434 100644
--- a/Sema/Sema.h
+++ b/Sema/Sema.h
@@ -21,6 +21,10 @@
#include <vector>
#include <string>
+namespace llvm {
+ class APSInt;
+}
+
namespace clang {
class ASTContext;
class Preprocessor;
@@ -427,6 +431,13 @@
/// otherwise emit a diagnostic and return true.
bool VerifyConstantArrayType(const ArrayType *ary, SourceLocation loc);
+ /// ConvertIntegerToTypeWarnOnOverflow - Convert the specified APInt to have
+ /// the specified width and sign. If an overflow occurs, detect it and emit
+ /// the specified diagnostic.
+ void ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &OldVal,
+ unsigned NewWidth, bool NewSign,
+ SourceLocation Loc, unsigned DiagID);
+
//===--------------------------------------------------------------------===//
// Extra semantic analysis beyond the C type system
private: