https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65361
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- --- gcc/testsuite/g++.dg/lto/pr65361_0.C.jj 2015-03-09 16:43:42.720534781 +0100 +++ gcc/testsuite/g++.dg/lto/pr65361_0.C 2015-03-09 16:47:00.325356410 +0100 @@ -0,0 +1,6 @@ +// { dg-lto-do link { xfail } } +// { dg-lto-options { { -flto -O2 } } } +// { dg-extra-ld-options "-r -nostdlib -O2" } + +struct A { A () {} virtual ~A () {} }; +A a; --- gcc/testsuite/g++.dg/lto/pr65361_1.C.jj 2015-03-09 16:43:45.981482330 +0100 +++ gcc/testsuite/g++.dg/lto/pr65361_1.C 2015-03-09 16:39:00.000000000 +0100 @@ -0,0 +1,3 @@ +struct B {}; +struct A : public B { A () {} virtual ~A () {} }; +A b; reproduces this, but unfortunately lto.exp doesn't support link failures, nor error messages out of lto1 during the linking. So I'm afraid we need to live without a testcase for now. BTW, I see several spots with __attribute__((visibility ("default"))) on std namespace in g++.dg/lto/, bet that is undesirable if some target would support LTO, but not visibilities.