Don't perform integer promotions on the operand to a cast; this

simplifies the AST, and can matter in some rare cases involving 
casts to vector types. Patch by Enea Zaffanella.

llvm-svn: 79126
This commit is contained in:
Eli Friedman 2009-08-15 19:02:19 +00:00
parent 0aed0225b4
commit da8d4def72
2 changed files with 2 additions and 2 deletions

View File

@ -2992,7 +2992,7 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr,
if (getLangOptions().CPlusPlus)
return CXXCheckCStyleCast(TyR, castType, castExpr, Kind, FunctionalStyle);
UsualUnaryConversions(castExpr);
DefaultFunctionArrayConversion(castExpr);
// C99 6.5.4p2: the cast type needs to be void or scalar and the expression
// type needs to be scalar.

View File

@ -20,7 +20,7 @@ void f()
type 't1' and scalar type 'char *'}}
v1 = (t1)(long long)10;
v1 = (t1)(short)10; // -expected-error {{invalid conversion between vector \
type 't1' and integer type 'int' of different size}}
type 't1' and integer type 'short' of different size}}
long long r1 = (long long)v1;
short r2 = (short)v1; // -expected-error {{invalid conversion between vector \