summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/save1.C
blob: 2358eb50c9d7f3f2e70bafab5f74e73979404ef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/8748
// We were wrapping the ARRAY_REF in a SAVE_EXPR, causing us to try to make a bitwise
// copy of b[0].

struct A
{
    int i;
};

struct B : A
{
    virtual ~B();
};

struct C
{
    B b[1];
};

void foo() { C().b[0].i; }