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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Because of the alias template build_converted_constant_expr produces a
TARGET_EXPR containing a TEMPLATE_PARM_INDEX which makes it value-dependent. 
So we don't call get_template_parm_object here

 7449       /* Replace the argument with a reference to the corresponding
template
 7450          parameter object.  */
 7451       if (!value_dependent_expression_p (expr))
 7452         expr = get_template_parm_object (expr, complain);

we crash in pt.c:
16396               /* Wrapper to make a C++20 template parameter object const.
 */
16397               op = tsubst_copy (op, args, complain, in_decl);
...
16405                   gcc_assert (CP_TYPE_CONST_P (TREE_TYPE (op)));

because tsubst_copy didn't turn op into one of those _ZT... VAR_DECLs.

Poking more.

Reply via email to