| 1 |
// { dg-do compile } |
| 2 |
// Contributed by Bill Helfinstine <bhelf at flitterfly dot whirpon dot com> |
| 3 |
// PR c++/14932: Allow subscript operator in offsetof |
| 4 |
|
| 5 |
#include <cstddef> |
| 6 |
|
| 7 |
struct A |
| 8 |
{ |
| 9 |
int bar; |
| 10 |
int foo[22]; |
| 11 |
}; |
| 12 |
|
| 13 |
const int off = offsetof(A, foo[12]); |