https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86523
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- One more test-case with a bit different BT: $ cat ice.ii namespace { class a typedef b; class a {}; } // namespace class c { struct C { b d; }; C e() const; }; c::C c::e() const { C g; struct h { C g; h(C *) {} } f(&g); } $ g++ ice.ii -O2 -flto=8 -g -shared ice.ii: In member function ‘c::C c::e() const’: ice.ii:17:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ lto1: internal compiler error: in dwarf2out_finish, at dwarf2out.c:31107 0x5c87cd dwarf2out_finish /home/marxin/Programming/gcc/gcc/dwarf2out.c:31107 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. make: *** [/tmp/cc5TI8Oi.mk:2: /tmp/ccQqbTv7.ltrans0.ltrans.o] Error 1 lto-wrapper: fatal error: make returned 2 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status