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 | 5eca6ada3a0c70d3d844c11e48fab3856baa1d88 (patch) | |
| tree | 272f65b23b58aafb4d18ffa49d61437eb59e8497 /clang/test/Sema/exprs.c | |
| parent | 4723fb70a97f97ad0341c110add829687052c86f (diff) | |
| download | bcm5719-llvm-5eca6ada3a0c70d3d844c11e48fab3856baa1d88.tar.gz bcm5719-llvm-5eca6ada3a0c70d3d844c11e48fab3856baa1d88.zip | |
Implement C99 6.5.3.4p1, rejecting sizeof(bitfield)
llvm-svn: 62936
Diffstat (limited to 'clang/test/Sema/exprs.c')
| -rw-r--r-- | clang/test/Sema/exprs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c index 5413757df79..db2daf1f7ca 100644 --- a/clang/test/Sema/exprs.c +++ b/clang/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; } |

