aboutsummaryrefslogtreecommitdiff
path: root/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
commit1d524c3dde58e4402aab4165e85e9ae6f15f5023 (patch)
treee510eff35416a6d52b74fcf02ff419ada5181a29 /test/SemaCXX/conditional-expr.cpp
parent5d7d37506319d432f8f5e3952b7427e1e4aacd2e (diff)
Diagnose taking the address of a bit-field inside a conditional operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/conditional-expr.cpp')
-rw-r--r--test/SemaCXX/conditional-expr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/SemaCXX/conditional-expr.cpp b/test/SemaCXX/conditional-expr.cpp
index 65fbd83e6d..fea3324b5f 100644
--- a/test/SemaCXX/conditional-expr.cpp
+++ b/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.