https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121239
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:ba5a6787374dea3e90f09771134d16b9f6d2714e commit r16-2519-gba5a6787374dea3e90f09771134d16b9f6d2714e Author: Patrick Palka <ppa...@redhat.com> Date: Fri Jul 25 10:55:35 2025 -0400 c++: more name lookup for non-dep rewritten cmp ops As a follow-up to r16-2448-g7590c14b53a762, this patch attempts to teach build_min_non_dep_op_overload how to rebuild all rewritten comparison operators, not just != -> == ones, so that we don't incorrectly repeat the unqualified name lookup at instantiation time. Note that changes how we mangle such comparison ops, in a way that is overall more consistent with how we've been mangling non-rewritten operators, see PR c++/121239. gcc/cp/ChangeLog: * call.cc (build_new_op): If the selected candidate is rewritten, communicate the LOOKUP_REWRITTEN/REVERSED flags to the caller via the 'overload' out-parameter, and stop clearing '*overload' in that case. * tree.cc (build_min_non_dep_op_overload): Handle rebuilding all C++20 rewritten comparison operator expressions. gcc/testsuite/ChangeLog: * g++.dg/lookup/operator-8.C: Remove XFAILs and properly suppress all -Wunused-result warnings. Reviewed-by: Jason Merrill <ja...@redhat.com>