http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56915
Bug #: 56915 Summary: [4.9 regression] ICE in symtab_add_to_same_comdat_group, at symtab.c:383 Classification: Unclassified Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: zeratul...@hotmail.com For the following code: template <typename T> class A { typename T::type b(); }; template <typename T, typename U> void waldo(T, U); template <typename T> void bar() { waldo([](A<T> a){ return a; }, []{}); } int main() { bar<int>(); } GCC 4.9 (r197687) gives the following output: test.cpp: In instantiation of 'class A<int>': test.cpp:13:20: required from 'bar() [with T = int]::__lambda0' test.cpp:13:12: required from 'struct bar() [with T = int]::__lambda0' test.cpp:14:15: required from 'void bar() [with T = int]' test.cpp:19:14: required from here test.cpp:4:22: error: 'int' is not a class, struct, or union type typename T::type b(); ^ test.cpp: In instantiation of 'struct bar() [with T = int]::__lambda1': test.cpp:14:15: required from 'void bar() [with T = int]' test.cpp:19:14: required from here test.cpp:14:12: internal compiler error: in symtab_add_to_same_comdat_group, at symtab.c:383 []{}); ^ 0x7ae403 symtab_add_to_same_comdat_group(symtab_node_def*, symtab_node_def*) ../../src/gcc/symtab.c:383 0x687031 maybe_add_lambda_conv_op(tree_node*) ../../src/gcc/cp/semantics.c:9767 0x5a20e8 instantiate_class_template_1 ../../src/gcc/cp/pt.c:9028 0x5a20e8 instantiate_class_template(tree_node*) ../../src/gcc/cp/pt.c:9081 0x62b02b complete_type(tree_node*) ../../src/gcc/cp/typeck.c:131 0x56325c tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:14532 0x5640a3 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool) ../../src/gcc/cp/pt.c:13955 0x56bfaf tsubst_expr ../../src/gcc/cp/pt.c:13376 0x56c50f tsubst_expr ../../src/gcc/cp/pt.c:12855 0x56ba4b tsubst_expr ../../src/gcc/cp/pt.c:12841 0x56c824 tsubst_expr ../../src/gcc/cp/pt.c:13031 0x56a3fb instantiate_decl(tree_node*, int, bool) ../../src/gcc/cp/pt.c:18904 0x5a5946 instantiate_pending_templates(int) ../../src/gcc/cp/pt.c:19003 0x5e073d cp_write_global_declarations() ../../src/gcc/cp/decl2.c:4031