view gcc/testsuite/g++.dg/init/save1.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

// 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; }