gcc/testsuite/g++.old-deja/g++.brendan/alignof.C
raw| 1 | // { dg-do assemble } |
| 2 | // GROUPS passed extensions |
| 3 | struct bar { int bit : 1; }; |
| 4 | |
| 5 | void foo (int *r, bar t) |
| 6 | { |
| 7 | // doing alignof on a bit-field should be illegal |
| 8 | __alignof__ (t.bit);// { dg-error "18:invalid application" } .* |
| 9 | |
| 10 | // both of these (a regular ref and an INDIRECT_REF) should work |
| 11 | __alignof__ (r); |
| 12 | __alignof__ (*r); |
| 13 | } |