diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2014-01-07 07:59:31 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2014-01-07 07:59:31 +0000 |
commit | d07dcdb9588bada1c6f827d0a1f6c2dd682e6f27 (patch) | |
tree | bcfad9cc9c0c44496fb7e4dd6de21bcdd4894469 /clang/test/SemaCXX/vector-casts.cpp | |
parent | dfacda363549778e07c92fc707298a5317c901ab (diff) | |
download | bcm5719-llvm-d07dcdb9588bada1c6f827d0a1f6c2dd682e6f27.tar.gz bcm5719-llvm-d07dcdb9588bada1c6f827d0a1f6c2dd682e6f27.zip |
For areVectorOperandsLaxBitCastable(), only return false if both opearands are vector types
and add a diagnostic when the operand is a vector and non-scalar value.
rdar://15722301
llvm-svn: 198680
Diffstat (limited to 'clang/test/SemaCXX/vector-casts.cpp')
-rw-r--r-- | clang/test/SemaCXX/vector-casts.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/vector-casts.cpp b/clang/test/SemaCXX/vector-casts.cpp index 681a07ea470..25c59e64276 100644 --- a/clang/test/SemaCXX/vector-casts.cpp +++ b/clang/test/SemaCXX/vector-casts.cpp @@ -37,4 +37,12 @@ void f() { (void)(__v4hi)v8hi; // expected-error {{C-style cast from vector '__v8hi' to vector '__v4hi' of different size}} } - +struct testvec { + __v2si v; + void madd(const testvec& rhs) { + v = v + rhs; // expected-error {{can't convert between vector and non-scalar values}} + } + void madd2(testvec rhs) { + v = v + rhs; // expected-error {{can't convert between vector and non-scalar values}} + } +}; |