blob: de6b2c477352a7811110abf933888df4a0c7a976 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O2 -Wstrict-aliasing" } */
struct Node_base {};
struct Node : Node_base
{
int data;
};
struct List
{
Node_base node, *prev;
List() : prev(&node) { xyz(); }
void xyz();
int back() { return static_cast<Node*>(prev)->data; }
};
struct A
{
virtual ~A();
};
A* foo();
void bar()
{
List y;
if (y.back())
delete foo();
}