https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71784
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-invalid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2016-07-07 Summary|crash on on ref-qual's and |[6/7 Regression] ICE on |templates |invalid code in | |push_access_scope, at | |cp/pt.c:229 Ever confirmed|0 |1 --- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> --- Minimal test-case: template <typename> class A { template <typename U> A<U> &&operator=(A<U> &&)&; template <typename U> A<U> &&operator=(A<U> &&)&&; } template A < int >&&A < int >::operator= ( A && Same as the origin, it's obviously an invalid code. g++ tc.cc tc.cc:4:1: error: expected ‘;’ after class definition } ^ tc.cc:5:46: error: expected ‘,’ or ‘...’ at end of input template A < int >&&A < int >::operator= ( A && ^~ tc.cc:5:46: error: expected ‘)’ at end of input tc.cc:5:46: internal compiler error: in push_access_scope, at cp/pt.c:228 0x844593 push_access_scope ../../gcc/cp/pt.c:227 0x8a30de fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool) ../../gcc/cp/pt.c:17920 0x8afed3 get_bindings ../../gcc/cp/pt.c:20730 0x8b02f3 more_specialized_inst ../../gcc/cp/pt.c:20828 0x8b0427 most_specialized_instantiation(tree_node*) ../../gcc/cp/pt.c:20868 0x851b48 determine_specialization ../../gcc/cp/pt.c:2326 0x8544a4 check_explicit_specialization(tree_node*, tree_node*, int, int) ../../gcc/cp/pt.c:2947 0x81aa67 grokfndecl ../../gcc/cp/decl.c:8228 0x824464 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ../../gcc/cp/decl.c:11424 0x94c571 cp_parser_explicit_instantiation ../../gcc/cp/parser.c:15650 0x94692a cp_parser_declaration ../../gcc/cp/parser.c:12100 0x946671 cp_parser_declaration_seq_opt ../../gcc/cp/parser.c:12027 0x9366da cp_parser_translation_unit ../../gcc/cp/parser.c:4329 0x983965 c_parse_file() ../../gcc/cp/parser.c:37491 0xb267a2 c_common_parse_file() ../../gcc/c-family/c-opts.c:1070