The following (probably invalid) code snippet triggers an ICE on trunk (4.9.0 20130926) when compiled with "std=c++0x -flto": ==================== auto foo(); auto fp = foo; ==================== bug.cc:1:10: warning: 'foo' function uses 'auto' type specifier without trailing return type [enabled by default] auto foo(); ^ bug.cc:3:14: internal compiler error: tree code 'template_type_parm' is not supported in LTO streams auto fp = foo; ^ 0xa17696 DFS_write_tree ../../gcc/gcc/lto-streamer-out.c:1244 0xa165c9 DFS_write_tree_body ../../gcc/gcc/lto-streamer-out.c:461 0xa165c9 DFS_write_tree ../../gcc/gcc/lto-streamer-out.c:1152 0xa165c9 DFS_write_tree_body ../../gcc/gcc/lto-streamer-out.c:461 0xa165c9 DFS_write_tree ../../gcc/gcc/lto-streamer-out.c:1152 0xa18907 lto_output_tree(output_block*, tree_node*, bool, bool) ../../gcc/gcc/lto-streamer-out.c:1334 0xa12cfc write_global_stream ../../gcc/gcc/lto-streamer-out.c:2084 0xa1a990 lto_output_decl_state_streams ../../gcc/gcc/lto-streamer-out.c:2128 0xa1a990 produce_asm_for_decls ../../gcc/gcc/lto-streamer-out.c:2413 0xa4e720 ipa_write_summaries_2 ../../gcc/gcc/passes.c:2283 0xa4f799 ipa_write_summaries_1 ../../gcc/gcc/passes.c:2314 0xa4f799 ipa_write_summaries() ../../gcc/gcc/passes.c:2371 0x807c5b ipa_passes ../../gcc/gcc/cgraphunit.c:2019 0x807c5b compile() ../../gcc/gcc/cgraphunit.c:2115 0x807ee9 finalize_compilation_unit() ../../gcc/gcc/cgraphunit.c:2269 0x61b2b0 cp_write_global_declarations() ../../gcc/gcc/cp/decl2.c:4360 Please submit a full bug report, [etc.] In GCC 4.8.1 the code was rejected: bug.cc:1:10: warning: 'foo' function uses 'auto' type specifier without trailing return type [enabled by default] auto foo(); ^ bug.cc:3:11: error: use of 'auto foo()' before deduction of 'auto' auto fp = foo;
Confirmed with trunk. Interesting is that with -std=gnu++1y: w.C:3:11: error: use of ‘auto foo()’ before deduction of ‘auto’ auto fp = foo; ^
This one seems to start with r198099 -- but it might be some other latent issue...
language specific trees should not leak to LTO. If this is invalid input then raise an error - we won't even start streaming into LTO bytecode then.
Fixed.
Author: jason Date: Fri Jan 24 19:05:39 2014 New Revision: 207055 URL: http://gcc.gnu.org/viewcvs?rev=207055&root=gcc&view=rev Log: PR c++/58550 * decl.c (grokdeclarator): Turn pedwarn about auto return type in c++11 into error. Added: trunk/gcc/testsuite/g++.dg/cpp0x/auto41.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c