Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -7338,6 +7338,11 @@ return QualType(); } + // Otherwise, if one is a vector and one isn't, treat it as a general invalid + // combination, rather than as an incompatibility between two vector sizes. + if (!LHSVecType || !RHSVecType) + return InvalidOperands(Loc, LHS, RHS); + // Otherwise, use the generic diagnostic. Diag(Loc, diag::err_typecheck_vector_not_convertable) << LHSType << RHSType Index: test/Sema/ext_vector_casts.c =================================================================== --- test/Sema/ext_vector_casts.c +++ test/Sema/ext_vector_casts.c @@ -102,11 +102,11 @@ vs = 65536 + vs; // expected-warning {{implicit conversion from 'int' to 'short8' (vector of 8 'short' values) changes value from 65536 to 0}} vs = vs + i; // expected-warning {{implicit conversion loses integer precision}} vs = vs + 1; - vs = vs + 1.f; // expected-error {{can't convert between vector values of different size}} + vs = vs + 1.f; // expected-error {{invalid operands to binary expression}} vi = l + vi; // expected-warning {{implicit conversion loses integer precision}} vi = 1 + vi; - vi = vi + 2.0; // expected-error {{can't convert between vector values of different size}} + vi = vi + 2.0; // expected-error {{invalid operands to binary expression}} vi = vi + 0xffffffff; // expected-warning {{implicit conversion changes signedness}} vl = l + vl; // expected-warning {{implicit conversion changes signedness}} Index: test/SemaOpenCL/cond.cl =================================================================== --- test/SemaOpenCL/cond.cl +++ test/SemaOpenCL/cond.cl @@ -89,7 +89,7 @@ float2 ntest05(int2 C, int2 X, float Y) { - return C ? X : Y; // expected-error {{can't convert between vector values of different size ('int2' (vector of 2 'int' values) and 'float')}} + return C ? X : Y; // expected-error {{invalid operands to binary expression ('int2' (vector of 2 'int' values) and 'float')}} } char2 ntest06(int2 C, char2 X, char2 Y)