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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-11-26
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems while parsing the default argument of the template parameter
finish_call_expr notes the argument of the index_sequence2mask call is
non-dependent, so make_args_non_dependent wraps that argument with
NON_DEPENDENT_EXPR.
But later we call build_new_function_call -> build_over_call ->
fold_non_dependent_expr -> fold_non_dependent_expr_template ->
instantiate_non_dependent_expr_internal -> tsubst_copy_and_build
which instantiates it, but the NON_DEPENDENT_EXPR is still among the arguments.
Later build_over_call sees it is a call to an immediate function and so calls
cxx_constant_value on it, but the constant evaluation fails because
NON_DEPENDENT_EXPR isn't handled in constexpr.c at all.
Shall constexpr.c handle NON_DEPENDENT_EXPR, or can that wrap expressions that
really can't be constant expression evaluated?

Reply via email to