gcc/testsuite/g++.dg/other/offsetof4.C
raw| 1 | /* Verify that -Wno-invalid-offsetof disables warning */ |
| 2 | /* Copyright (C) 2003 Free Software Foundation, Inc. */ |
| 3 | /* Contributed by Matt Austern <[email protected]> 15 May 2003 */ |
| 4 | /* { dg-do compile } */ |
| 5 | /* { dg-options "-Wno-invalid-offsetof" } */ |
| 6 | |
| 7 | struct X |
| 8 | { |
| 9 | X() : x(3), y(4) { } |
| 10 | int x, y; |
| 11 | }; |
| 12 | |
| 13 | typedef X* pX; |
| 14 | typedef __SIZE_TYPE__ size_t; |
| 15 | |
| 16 | size_t yoff = size_t(&(pX(0)->y)); |