From e4aa93def3f973650b8348aee921f47f8bd34888 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Thu, 8 Jan 2026 16:09:38 -0500 Subject: [PATCH] Fix TODO in eval_object_of --- gcc/cp/reflect.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc index c0a47659aa9..08710f6f878 100644 --- a/gcc/cp/reflect.cc +++ b/gcc/cp/reflect.cc @@ -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);