Fix TODO in eval_object_of

This commit is contained in:
Marek Polacek
2026-01-08 16:09:38 -05:00
parent 3862920c26
commit e4aa93def3

View File

@@ -2619,14 +2619,14 @@ maybe_get_reference_referent (tree r)
static tree
eval_object_of (location_t loc, const constexpr_ctx *ctx, tree r,
reflect_kind kind, bool *non_constant_p, tree *jump_target,
tree fun)
reflect_kind kind, bool *non_constant_p, bool *overflow_p,
tree *jump_target, tree fun)
{
tree orig = r;
if (TYPE_REF_P (TREE_TYPE (r)))
r = DECL_INITIAL (r);
r = cxx_eval_constant_expression (ctx, r, vc_prvalue, non_constant_p,
overflow_p, jump_target);
r = maybe_get_reference_referent (r);
// TODO check "usable in constant expressions"
if (eval_has_static_storage_duration (orig, kind) == boolean_false_node
&& (orig == r
|| eval_has_static_storage_duration (r, kind) == boolean_false_node))
@@ -7466,8 +7466,8 @@ process_metafunction (const constexpr_ctx *ctx, tree fun, tree call,
case METAFN_TYPE_OF:
return eval_type_of (loc, ctx, h, kind, non_constant_p, jump_target, fun);
case METAFN_OBJECT_OF:
return eval_object_of (loc, ctx, h, kind, non_constant_p, jump_target,
fun);
return eval_object_of (loc, ctx, h, kind, non_constant_p, overflow_p,
jump_target, fun);
case METAFN_CONSTANT_OF:
return eval_constant_of (loc, ctx, h, kind, non_constant_p, overflow_p,
jump_target, fun);