PR c++/53848
[official-gcc.git] / gcc / testsuite / g++.dg / other / offsetof3.C
blob5946c812ced7a983857c64c9a678fe7be8e7605d
1 /* Verify that offsetof warns if given a non-standard-layout class */
2 /* Copyright (C) 2003 Free Software Foundation, Inc. */
3 /* Contributed by Matt Austern <austern@apple.com> 15 May 2003 */
4 /* { dg-do compile } */
6 struct X
8   int x, y;
9 protected:
10   int z;
13 typedef X* pX;
14 typedef __SIZE_TYPE__ size_t;
16 size_t yoff = size_t(&(pX(0)->y)); /* { dg-warning "invalid access" "" } */
17 /* { dg-warning "macro was used incorrectly" "macro" { target *-*-* } 16 } */