1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/* { dg-do compile } */ /* { dg-options "-O2 -Wstrict-aliasing" } */ #include<list> struct A { virtual ~A(); }; A* foo(); void bar(std::list<int> x) { std::list<int> y = x; if (*y.rbegin()) delete foo(); }