Drop eval_is_type checks before calling eval_is_function_type.

This isn't needed after https://forge.sourceware.org/marek/gcc/commit/34293549c7c3
because it is process_metafunction which throws for is_function_type,
not eval_is_function_type, and the latter just returns boolean_false_node
if the argument is not a type.
This commit is contained in:
Jakub Jelinek
2026-01-07 11:37:57 +01:00
committed by Marek Polacek
parent 16a7a7dd28
commit 29c610e1df

View File

@@ -2778,8 +2778,7 @@ eval_is_noexcept (tree r)
return boolean_false_node;
}
if (eval_is_type (r) == boolean_true_node
&& eval_is_function_type (r) == boolean_true_node
if (eval_is_function_type (r) == boolean_true_node
&& TYPE_NOTHROW_P (r))
return boolean_true_node;
@@ -3033,8 +3032,7 @@ eval_parameters_of (location_t loc, const constexpr_ctx *ctx, tree r,
bool *non_constant_p, tree *jump_target, tree fun)
{
if (eval_is_function (r) != boolean_true_node
&& (eval_is_type (r) != boolean_true_node
|| eval_is_function_type (r) != boolean_true_node))
&& eval_is_function_type (r) != boolean_true_node)
return throw_exception_nofn (loc, ctx, fun, non_constant_p, jump_target);
r = maybe_get_reflection_fndecl (r);
@@ -3084,8 +3082,7 @@ eval_return_type_of (location_t loc, const constexpr_ctx *ctx, tree r,
tree fun)
{
if ((eval_is_function (r) != boolean_true_node || !has_type (r, kind))
&& (eval_is_type (r) != boolean_true_node
|| eval_is_function_type (r) != boolean_true_node))
&& eval_is_function_type (r) != boolean_true_node)
return throw_exception_nofn (loc, ctx, fun, non_constant_p, jump_target);
r = MAYBE_BASELINK_FUNCTIONS (r);