Chris Lattner a65e1f3b31 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.

llvm-svn: 46083
2008-01-16 19:17:22 +00:00

10 lines
118 B
C

// RUN: clang %s -emit-llvm
void foo(int x) {
switch (x) {
case 111111111111111111111111111111111111111:
bar();
}
}