/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing" } */ /* { dg-skip-if "requires hosted libstdc++ for list" { ! hostedlib } } */ #include struct A { virtual ~A(); }; A* foo(); void bar(std::list x) { std::list y = x; if (*y.rbegin()) delete foo(); }