Tweak compare_reflections

This commit is contained in:
Marek Polacek
2026-01-13 18:03:11 -05:00
parent 637f41dbb3
commit 79f1e91cc9

View File

@@ -8230,12 +8230,12 @@ check_out_of_consteval_use (tree expr, bool complain/*=true*/)
bool
compare_reflections (tree lhs, tree rhs)
{
reflect_kind kind;
reflect_kind lkind;
do
{
if (REFLECT_EXPR_KIND (lhs) != REFLECT_EXPR_KIND (rhs))
lkind = REFLECT_EXPR_KIND (lhs);
if (lkind != REFLECT_EXPR_KIND (rhs))
return false;
kind = REFLECT_EXPR_KIND (lhs);
lhs = REFLECT_EXPR_HANDLE (lhs);
rhs = REFLECT_EXPR_HANDLE (rhs);
}
@@ -8253,12 +8253,12 @@ compare_reflections (tree lhs, tree rhs)
// ??? Can we do something better?
lhs = maybe_get_reflection_fndecl (lhs);
rhs = maybe_get_reflection_fndecl (rhs);
if (kind == REFLECT_PARM)
if (lkind == REFLECT_PARM)
{
lhs = maybe_update_function_parm (lhs);
rhs = maybe_update_function_parm (rhs);
}
else if (kind == REFLECT_DATA_MEMBER_SPEC)
else if (lkind == REFLECT_DATA_MEMBER_SPEC)
return (TREE_VEC_ELT (lhs, 0) == TREE_VEC_ELT (rhs, 0)
&& TREE_VEC_ELT (lhs, 1) == TREE_VEC_ELT (rhs, 1)
&& tree_int_cst_equal (TREE_VEC_ELT (lhs, 2),