https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98659
Bug ID: 98659 Summary: [11 Regression] ICE tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in maybe_instantiate_noexcept, at cp/pt.c:25445 since r11-6476-gaf362af18f405c34 Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: mpolacek at gcc dot gnu.org Target Milestone: --- The following is reduced from mkvtoolnix package: $ cat reader.ii template <bool> struct enable_if; class function { public: template <typename _Functor> void operator=(_Functor); }; class map { public: function operator[](int); }; enum { avc_es }; template <typename> void do_probe(); template <typename Treader> typename enable_if<Treader ::value>::type do_probe(); void prober_for_type() { map type_probe_map; type_probe_map[avc_es] = do_probe<int>; } $ g++ reader.ii -c reader.ii: In substitution of ‘template<class _Functor> void function::operator=(_Functor) [with _Functor = <missing>]’: reader.ii:16:28: required from here reader.ii:16:28: internal compiler error: tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in maybe_instantiate_noexcept, at cp/pt.c:25462 16 | type_probe_map[avc_es] = do_probe<int>; | ^~~~~~~~~~~~~ 0x8a7470 tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) /home/marxin/Programming/gcc/gcc/tree.c:9984 0x71256f contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) /home/marxin/Programming/gcc/gcc/tree.h:3452 0x71256f maybe_instantiate_noexcept(tree_node*, int) /home/marxin/Programming/gcc/gcc/cp/pt.c:25462 0xb59cc9 resolve_overloaded_unification /home/marxin/Programming/gcc/gcc/cp/pt.c:22386 0xb59cc9 unify_one_argument /home/marxin/Programming/gcc/gcc/cp/pt.c:21932 0xb72005 type_unification_real /home/marxin/Programming/gcc/gcc/cp/pt.c:22076 0xb81de9 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) /home/marxin/Programming/gcc/gcc/cp/pt.c:21445 0x986a63 add_template_candidate_real /home/marxin/Programming/gcc/gcc/cp/call.c:3441 0x98745c add_template_candidate /home/marxin/Programming/gcc/gcc/cp/call.c:3526 0x98745c add_candidates /home/marxin/Programming/gcc/gcc/cp/call.c:5955 0x989f99 add_candidates /home/marxin/Programming/gcc/gcc/cp/call.c:5870 0x989f99 add_operator_candidates /home/marxin/Programming/gcc/gcc/cp/call.c:6074 0x9915ef build_new_op_1 /home/marxin/Programming/gcc/gcc/cp/call.c:6282 0x992351 build_new_op(op_location_t const&, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node**, int) /home/marxin/Programming/gcc/gcc/cp/call.c:6670 0xbeff5c cp_build_modify_expr(unsigned int, tree_node*, tree_code, tree_node*, int) /home/marxin/Programming/gcc/gcc/cp/typeck.c:8695 0xbf08b8 build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*, int) /home/marxin/Programming/gcc/gcc/cp/typeck.c:8957 0xaed67e cp_parser_assignment_expression /home/marxin/Programming/gcc/gcc/cp/parser.c:10172 0xaef022 cp_parser_expression /home/marxin/Programming/gcc/gcc/cp/parser.c:10298 0xaf2648 cp_parser_expression_statement /home/marxin/Programming/gcc/gcc/cp/parser.c:11965 0xafe880 cp_parser_statement /home/marxin/Programming/gcc/gcc/cp/parser.c:11761 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.