diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index ced300b4d731..1a519ffc1b6e 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -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. diff --git a/clang/test/Sema/vector-cast.c b/clang/test/Sema/vector-cast.c index 9460cac6d187..8c607aad073e 100644 --- a/clang/test/Sema/vector-cast.c +++ b/clang/test/Sema/vector-cast.c @@ -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 \