Hi Everybody,
The OpenCL standard allows the initialization of vector literals as follows:
typedef __attribute__ ((ext_vector_type(4))) int int4;
uint4 u = (uint4)(1); // u will be (1, 1, 1, 1)
refer to section 6.1.6 of the OpenCL manual.
clang instead forbids this kind of initialization:
error: too few elements in vector initialization (expected 4 elements, have 1)
The attached patch tries to solve the problem.
Do you agree with my solution ?
Alberto
single_element_compound_stmt.patch (1.42 KB)