Under certain circumstances, see attachment, linking with -flto fails: gcc-4.5 r152491
gcc-4.5 -flto -lstdc++ main.cpp -o a.out /tmp/ccWovgK1.lto.o:(.rodata._ZTV33ClientNetworkContentSocketHandler[_ZTV33ClientNetworkContentSocketHandler]+0x30): undefined reference to `_ZThn8_N33ClientNetworkContentSocketHandler9OnConnectEb' collect2: ld returned 1 exit status gcc-4.5 -lstdc++ main.cpp -o a.out <no error, binary made> -- Summary: undefined references when linking with -flto Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rubidium at openttd dot org GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41602