OSDN Git Service

PR c++/28878
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / packed8.C
1 // PR c++/18378
2 // NOTE: This test assumes packed structure layout differs from unpacked
3 //       structure layout.  This isn't true, e.g., with the default
4 //       arm-none-elf options.
5 // { dg-options "-mstructure-size-boundary=8" { target arm-*-* } }
6
7 class A
8 {
9 public:
10   int i;
11
12   A() {}
13   A(const A& a) { i = a.i; }
14 };
15
16 class B
17 {
18   A a __attribute__((packed)); // { dg-warning "attribute ignored" "" { target default_packed } }
19
20 public:
21   B() {}
22   A GetA() { return a; } // { dg-error "" "" { target { ! default_packed } } }
23 };
24