[cfe-commits] [PATCH] Missing arithmetic conversions in vector operations

Richard Smith richard at metafoo.co.uk
Thu Oct 27 20:13:18 PDT 2011


On Fri, October 28, 2011 03:41, Eli Friedman wrote:
> On Thu, Oct 27, 2011 at 7:02 PM, Richard Smith <richard at metafoo.co.uk> wrote:\
[...]
>> One unit test changed behavior (for an ext_vector_type vector):
>>
>>
>>  ish8 += 5; // expected-error {{...}}
>>  ish8 += (short)5;
>>
>>
>> We now reject the second line just like the first, since the short is
>> promoted back to int before being assigned. However, according to the OpenCL
>> specification (which I've been informed that ext_vector_type is supposed
>> to support), both of these lines should be legal.
>
> The test is correct as-is.  Try reading the section on usual
> arithmetic conversions again.

Ah, I see now. Somehow I'd managed to misinterpret that section every time I
read it. Thanks!

> Please just fix CheckVectorOperands to call
> DefaultFunctionArrayLvalueConversion.

Will do.

Best wishes,
Richard




More information about the cfe-commits mailing list