diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc index 18b5e56d606..87fecd287aa 100644 --- a/gcc/cp/reflect.cc +++ b/gcc/cp/reflect.cc @@ -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);