Bug#781060: g++-4.9: Broken optimization when move-constructing from virtual subclass

2015-03-24 Thread Kenton Varda
ted ? "true" : "false"); } }; class B: virtual public A {}; class C: virtual public B {}; class D: public C {}; int main() { A a = D(); } = On Tue, Mar 24, 2015 at 12:37 AM, Bastian Blank wrote: > Moin > > On Mon, Mar 23, 2015 at 03:18:08PM

Bug#781060: g++-4.9: Broken optimization when move-constructing from virtual subclass

2015-03-23 Thread Kenton Varda
Package: g++-4.9 Version: 4.9.2-10 Using g++ 4.9.2-10 on amd64, the below program behaves differently when compiled with -O2 vs. not. The non-optimized version is correct; the program's output should be: ~A(): moved = true ~A(): moved = false However, with the optimized version, the program inco