blob: 1476010cef3c96c22123000d3fbb81896921e6f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// PR c++/18378
// NOTE: This test assumes packed structure layout differs from unpacked
// structure layout.
class A
{
public:
int i;
A() {}
A(const A& a) { i = a.i; }
};
class B
{
A a __attribute__((packed)); // { dg-warning "attribute ignored" "" { target default_packed } }
public:
B() {}
A GetA() { return a; } // { dg-error "" "" { target { ! default_packed } } }
};
|