summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/conditional-expr.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-14 23:15:26 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-14 23:15:26 +0000
commit3fa58d1f63e06cecee8280160a984b5fae28c67e (patch)
tree3ee9096ae2536aa9885661ee957e97cc8c3a572c /clang/test/SemaCXX/conditional-expr.cpp
parent6010da024cec6cf301c2b41a4bff10c70f7643bf (diff)
downloadbcm5719-llvm-3fa58d1f63e06cecee8280160a984b5fae28c67e.tar.gz
bcm5719-llvm-3fa58d1f63e06cecee8280160a984b5fae28c67e.zip
Diagnose taking the address of a bit-field inside a conditional operator.
llvm-svn: 81808
Diffstat (limited to 'clang/test/SemaCXX/conditional-expr.cpp')
-rw-r--r--clang/test/SemaCXX/conditional-expr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/conditional-expr.cpp b/clang/test/SemaCXX/conditional-expr.cpp
index 65fbd83e6d2..fea3324b5fd 100644
--- a/clang/test/SemaCXX/conditional-expr.cpp
+++ b/clang/test/SemaCXX/conditional-expr.cpp
@@ -174,7 +174,9 @@ void test()
// Conversion of primitives does not result in an lvalue.
&(i1 ? i1 : d1); // expected-error {{address expression must be an lvalue or a function designator}}
-
+ (void)&(i1 ? flds.b1 : flds.i1); // expected-error {{address of bit-field requested}}
+ (void)&(i1 ? flds.i1 : flds.b1); // expected-error {{address of bit-field requested}}
+
// Note the thing that this does not test: since DR446, various situations
// *must* create a separate temporary copy of class objects. This can only
// be properly tested at runtime, though.
OpenPOWER on IntegriCloud