diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-24 21:29:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-24 21:29:22 +0000 |
commit | da0274725667d1168867dc404417f2c68c8dc0c5 (patch) | |
tree | f46afbd619a7f0f67bfd7c056512c8ff73a8b06d /test/Sema/exprs.c | |
parent | 84394a50e307e2f056e270e1eeadd4f26913cd1e (diff) |
Implement C99 6.5.3.4p1, rejecting sizeof(bitfield)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/exprs.c')
-rw-r--r-- | test/Sema/exprs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c index 5413757df7..db2daf1f7c 100644 --- a/test/Sema/exprs.c +++ b/test/Sema/exprs.c @@ -50,7 +50,10 @@ int test8(void) { // PR3386 struct f { int x : 4; float y[]; }; int test9(struct f *P) { - return __alignof(P->x) + // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}} - __alignof(P->y); // ok. expected-warning {{extension used}} + int R; + R = __alignof(P->x); // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}} + R = __alignof(P->y); // ok. expected-warning {{extension used}} + R = sizeof(P->x); // expected-error {{invalid application of 'sizeof' to bitfield}} + return R; } |