summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/reinterpret-cast.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-04-22 23:57:57 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-04-22 23:57:57 +0000
commitbf04231a7254b2423e4d801b3ee7b409f4ef985e (patch)
tree06aadc2e1bc292a01d98b429c951afbd8b878be1 /clang/test/SemaCXX/reinterpret-cast.cpp
parent58b59f9522a0aafd4c2efe0781a9c88f005b7e00 (diff)
downloadbcm5719-llvm-bf04231a7254b2423e4d801b3ee7b409f4ef985e.tar.gz
bcm5719-llvm-bf04231a7254b2423e4d801b3ee7b409f4ef985e.zip
Don't allow reinterpret_cast to reference of vector element and property expression. Thanks goes to Eli Friedman!
llvm-svn: 130036
Diffstat (limited to 'clang/test/SemaCXX/reinterpret-cast.cpp')
-rw-r--r--clang/test/SemaCXX/reinterpret-cast.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/reinterpret-cast.cpp b/clang/test/SemaCXX/reinterpret-cast.cpp
index 2ec45b37cde..f5262496c4b 100644
--- a/clang/test/SemaCXX/reinterpret-cast.cpp
+++ b/clang/test/SemaCXX/reinterpret-cast.cpp
@@ -111,5 +111,8 @@ void const_arrays() {
namespace PR9564 {
struct a { int a : 10; }; a x;
- int *y = &reinterpret_cast<int&>(x.a); // expected-error {{reinterpret_cast of a bit-field to 'int &' needs its address which is not allowed}}
+ int *y = &reinterpret_cast<int&>(x.a); // expected-error {{not allowed}}
+
+ __attribute((ext_vector_type(4))) typedef float v4;
+ float& w(v4 &a) { return reinterpret_cast<float&>(a[1]); } // expected-error {{not allowed}}
}
OpenPOWER on IntegriCloud