[PATCH] c++: Move consteval folding to cp_fold_r

Marek Polacek polacek@redhat.com
Fri Sep 1 17:36:35 GMT 2023


On Fri, Sep 01, 2023 at 01:23:48PM -0400, Marek Polacek via Gcc-patches wrote:
> --- a/gcc/cp/cp-gimplify.cc
> +++ b/gcc/cp/cp-gimplify.cc
[...]
>      case ADDR_EXPR:
>        if (TREE_CODE (TREE_OPERAND (stmt, 0)) == FUNCTION_DECL
> -	  && DECL_IMMEDIATE_FUNCTION_P (TREE_OPERAND (stmt, 0)))
> +	  && DECL_IMMEDIATE_FUNCTION_P (TREE_OPERAND (stmt, 0))
> +	  && !in_immediate_context ())

This hunk isn't actually necessary.  I'm happy to drop it.  Or add the
in_immediate_context check into case PTRMEM_CST too.

Marek



More information about the Gcc-patches mailing list