summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/expr-address-of.c3
-rw-r--r--clang/test/SemaCXX/ptrtomember.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/Sema/expr-address-of.c b/clang/test/Sema/expr-address-of.c
index 32bd0dfdd5b..480871afad2 100644
--- a/clang/test/Sema/expr-address-of.c
+++ b/clang/test/Sema/expr-address-of.c
@@ -102,8 +102,9 @@ char* f7() {
register struct {char* x;} t1 = {"Hello"};
char* dummy1 = &(t1.x[0]);
- struct {int a : 10;} t2;
+ struct {int a : 10; struct{int b : 10;};} t2;
int* dummy2 = &(t2.a); // expected-error {{address of bit-field requested}}
+ int* dummy3 = &(t2.b); // expected-error {{address of bit-field requested}}
void* t3 = &(*(void*)0);
}
diff --git a/clang/test/SemaCXX/ptrtomember.cpp b/clang/test/SemaCXX/ptrtomember.cpp
index aee535e5593..d4a4507d02a 100644
--- a/clang/test/SemaCXX/ptrtomember.cpp
+++ b/clang/test/SemaCXX/ptrtomember.cpp
@@ -13,9 +13,13 @@ int foo(int S::* ps, S *s)
struct S2 {
int bitfield : 1;
+ struct {
+ int anon_bitfield : 1;
+ };
};
int S2::*pf = &S2::bitfield; // expected-error {{address of bit-field requested}}
+int S2::*anon_pf = &S2::anon_bitfield; // expected-error {{address of bit-field requested}}
struct S3 {
void m();
OpenPOWER on IntegriCloud