[cfe-commits] [OpenCL patch] Clang fails on nested vector literals

Anton Lokhmotov Anton.Lokhmotov at arm.com
Fri Sep 23 08:57:57 PDT 2011


[http://llvm.org/bugs/show_bug.cgi?id=10974]

Nested vector literals (as allowed by OpenCL 6.1.6) may cause Clang to fail.

typedef int int2 __attribute((ext_vector_type(2)));
typedef int int4 __attribute((ext_vector_type(4)));

__constant int4 i_1_1_1_1 = (int4)(1,2,3,4); // works
__constant int4 i_1_2_1 = (int4)(1,(int2)(2,3),4); // fails

Please review the attached fix and test cases!

Many thanks,
Anton.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: literals_nested.patch
Type: application/octet-stream
Size: 6712 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110923/c1886f74/attachment.obj>


More information about the cfe-commits mailing list