http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60574
Bug ID: 60574 Summary: [4.9 Regression] [c++1y] ICE with deduced return type in virtual function and LTO Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, lto Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following questionable code snippet (compiled with "-std=c++1y -flto -fpermissive") triggers an ICE on trunk: ======================== struct A { virtual auto foo() {} }; struct B : A { auto foo(); }; B b; ======================== bug.cc:3:20: warning: virtual function cannot have deduced return type [-fpermissive] virtual auto foo() {} ^ bug.cc:11:4: internal compiler error: tree code 'template_type_parm' is not supported in LTO streams B b; ^ 0xabb20e DFS_write_tree ../../gcc/gcc/lto-streamer-out.c:1300 0xaba575 DFS_write_tree_body ../../gcc/gcc/lto-streamer-out.c:476 0xaba575 DFS_write_tree ../../gcc/gcc/lto-streamer-out.c:1208 0xaba575 DFS_write_tree_body ../../gcc/gcc/lto-streamer-out.c:476 0xaba575 DFS_write_tree ../../gcc/gcc/lto-streamer-out.c:1208 0xabc8d7 lto_output_tree(output_block*, tree_node*, bool, bool) ../../gcc/gcc/lto-streamer-out.c:1390 0xab6c7f write_global_stream ../../gcc/gcc/lto-streamer-out.c:2100 0xabeb1e lto_output_decl_state_streams ../../gcc/gcc/lto-streamer-out.c:2144 0xabeb1e produce_asm_for_decls() ../../gcc/gcc/lto-streamer-out.c:2429 0xb00eff write_lto ../../gcc/gcc/passes.c:2297 0xb03f48 ipa_write_summaries_1 ../../gcc/gcc/passes.c:2356 0xb03f48 ipa_write_summaries() ../../gcc/gcc/passes.c:2413 0x894044 ipa_passes ../../gcc/gcc/cgraphunit.c:2078 0x894044 compile() ../../gcc/gcc/cgraphunit.c:2174 0x8942f4 finalize_compilation_unit() ../../gcc/gcc/cgraphunit.c:2329 0x68d46e cp_write_global_declarations() ../../gcc/gcc/cp/decl2.c:4610 Please submit a full bug report, [etc.] In GCC 4.8.x the code was rejected.