From bf04231a7254b2423e4d801b3ee7b409f4ef985e Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 22 Apr 2011 23:57:57 +0000 Subject: Don't allow reinterpret_cast to reference of vector element and property expression. Thanks goes to Eli Friedman! llvm-svn: 130036 --- clang/test/SemaCXX/reinterpret-cast.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'clang/test/SemaCXX/reinterpret-cast.cpp') 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(x.a); // expected-error {{reinterpret_cast of a bit-field to 'int &' needs its address which is not allowed}} + int *y = &reinterpret_cast(x.a); // expected-error {{not allowed}} + + __attribute((ext_vector_type(4))) typedef float v4; + float& w(v4 &a) { return reinterpret_cast(a[1]); } // expected-error {{not allowed}} } -- cgit v1.2.3