Move promoteExprToType from being a static method in SemaExpr.cpp to being
a method named ImpCastExprToType in Sema.
Use this method to insert implicit casts for case statements from their
operand type to the condition type of the switch. This fixes a crash on
test/CodeGen/statements.c, reported by Eli Friedman.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46083 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/statements.c b/test/CodeGen/statements.c
new file mode 100644
index 0000000..46d19db
--- /dev/null
+++ b/test/CodeGen/statements.c
@@ -0,0 +1,9 @@
+// RUN: clang %s -emit-llvm
+
+void foo(int x) {
+switch (x) {
+case 111111111111111111111111111111111111111:
+bar();
+}
+}
+