http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53831
--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-03 13:11:59 UTC --- (In reply to comment #10) > > if I use -fno-fat-lto-objects I get a maybe more easily to debug linker > > failure > > I guess that's because in this case archive symtab doesn't reference any > symbols at all (which is another bug): > $ nm libdummy.a > impl.o: > 00000001 C __gnu_lto_slim > 00000001 C __gnu_lto_v1 > so linker doesn't get any symbols from impl.o (not even _ZTV1C). you need to use the LTO aware nm that gcc installs, gcc-nm. It says > gcc-nm-4.7 libdummy.a impl.o: 00000000 T _ZN1C1fEv 00000000 T _ZN1C1gEv 00000000 W _ZTV1C > > Or your program is invalid because you have no inline definition where you > have a use. > > I'm not sure whether inline virtual without definition is valid in C++. But I > googled a bit before submitting the bug and found no evidence that it's a > non-standard (and more importantly - non-lto g++ accepts this code > just fine). Btw, removing the 'inline' keyword everywhere still reproduces the issue. That makes the testcase certainly valid.