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

Anton Lokhmotov Anton.Lokhmotov at arm.com
Wed Jul 13 11:14:28 PDT 2011

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).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector-literals.patch
Type: application/octet-stream
Size: 9246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110713/c759d9f1/attachment.obj>

More information about the cfe-dev mailing list