diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/offsetof2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/ext/offsetof2.C | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ext/offsetof2.C b/gcc/testsuite/g++.dg/ext/offsetof2.C new file mode 100644 index 0000000..647cf8d --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/offsetof2.C @@ -0,0 +1,6 @@ +// PR c++/85662 +// { dg-do compile { target c++11 } } + +struct S { unsigned long x[31]; }; +struct T { bool b; S f; }; +static_assert (__builtin_offsetof (T, f.x[31 - 1]) == __builtin_offsetof (T, f.x[30]), ""); |