https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120037

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
           Keywords|                            |ice-on-invalid-code

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
get_tuple_decomp_init calls perform_koenig_lookup, that reports an error in
3265              if (complain & tf_error)
3266                fn = unqualified_fn_lookup_error (cp_expr (identifier,
loc));
and sets fn to the get IDENTIFIER.
3272      if (fn && template_id && fn != error_mark_node)
3273        fn = build2 (TEMPLATE_ID_EXPR, unknown_type_node, fn, tmpl_args);
later on returns the TEMPLATE_ID_EXPR rather than say error_mark_node,
get_tuple_decomp_init then calls finish_call_expr on it which returns CALL_EXPR
with NULL TREE_TYPE and we then call
10212             eltype = cp_build_reference_type (eltype, !lvalue_p (init));
on it and lvalue_p is what ICEs because it doesn't expect NULL TREE_TYPE.

Shall we somehow test whether the returned init is say type dependent and if
so,
avoid doing that
10210             /* Save the decltype away before reference collapse.  */
10211             hash_map_safe_put<hm_ggc> (decomp_type_table, v[i], eltype);
10212             eltype = cp_build_reference_type (eltype, !lvalue_p (init));
10213             TREE_TYPE (v[i]) = eltype;
10214             layout_decl (v[i], 0);
?

Reply via email to