[PATCH] D21678: Fix For pr28288 - Error message in shift of vector values

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 1 17:00:06 PDT 2016


ahatanak added a subscriber: ahatanak.
ahatanak added a comment.

This patch causes clang to error out on the following code, which used to compile fine:

$ cat f2.c

  typedef __attribute__((__ext_vector_type__(8))) unsigned short vector_ushort8;
  
  vector_ushort8 foo1(void) {
    return 1 << (vector_ushort8){7,6,5,4,3,2,1,0};
  }

$ clang f2.c -c

clang used to transform the scaler operand to a vector operand (similar to the way gcc's vector is handled) when compiling for normal c/c++ (but printed an error message when compiling for opencl), but this patch dropped the check for LangOpts added in r230464 and changed that behavior. I don't think this was intentional?


Repository:
  rL LLVM

https://reviews.llvm.org/D21678





More information about the cfe-commits mailing list