[cfe-dev] OpenCL patch: vector literals (alternative patch)

Tanya Lattner lattner at apple.com
Wed Jul 13 11:21:49 PDT 2011


Anton,

You shouldn't need to add anything from your patch to mine to get the test cases to work. Why do you think this extra code is necessary? Do you have a test case that isn't in the invalid/valid files that fails?

-Tanya

On Jul 13, 2011, at 11:14 AM, Anton Lokhmotov wrote:

> Hi Tanya,
> 
> We have merged your patch and ours.  It seems to work fine for both valid
> and invalid test cases.
> 
> John McCall wrote:
>> So this should be legal if C99 is an acceptable base language for
>> OpenCL and the following is valid:
>>  uchar4 vec = { x.lo };
> OpenCL is a superset of a subset of C99, so the fist condition is met.
> However, section 6.1.6 of the OpenCL specification says that only
> (typen)(...) is valid syntax for initializing vector literals, not {...}.
> So ideally Clang would reject it (but I appreciate this is undesirable for
> legacy reasons).
> 
> Thanks,
> Anton.<vector-literals.patch>




More information about the cfe-dev mailing list