aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/packed8.C
blob: 61d248e992857b92f6da0b8bd635f9a6fba32f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// PR c++/18378
// NOTE: This test assumes packed structure layout differs from unpacked
//       structure layout.  This isn't true, e.g., with the default
//       arm-none-elf options.
// { dg-options "-mstructure-size-boundary=8" { target arm-*-* } }

class A
{
public:
  int i;

  A() {}
  A(const A& a) { i = a.i; }
};

class B
{
  A a __attribute__((packed));

public:
  B() {}
  A GetA() { return a; } // { dg-error "" }
};