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

Eli Friedman eli.friedman at gmail.com
Fri Sep 23 12:35:03 PDT 2011


On Fri, Sep 23, 2011 at 8:57 AM, Anton Lokhmotov
<Anton.Lokhmotov at arm.com> wrote:
> [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!

It looks like you included some diffs you didn't mean to include?
(The changes to lib/AST/Expr.cpp and the first set of changes to
lib/AST/ExprConstant.cpp.)

I follow the concept of your patch, but it looks like you're deleting
a bunch of necessary code from lib/AST/ExprConstant.cpp.  Do we really
not have proper tests for those cases?

-Eli



More information about the cfe-commits mailing list