[Bug c++/98939] [C++23] Implement P1787R6 "Declarations and where to find them"
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 12 02:36:15 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98939
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:ae37ade22ecf4e4ca2911d6628f8bec20c3d6422
commit r16-7472-gae37ade22ecf4e4ca2911d6628f8bec20c3d6422
Author: Patrick Palka <ppalka@redhat.com>
Date: Wed Feb 11 21:35:35 2026 -0500
c++: relax ref-qual overloading rules for C++20 [PR98939]
As explained in one of Tomasz's library papers P2438R2[1], C++20 allows
ref-qualified member overloads to coexist with non-ref-qualified ones,
but at the time of writing no compiler supported that. This patch
implements this C++20 relaxation so that we can in turn implement
P2438R2 as originally intended -- without needing to change the
signature of the main string::substr overload.
[1]: https://wg21.link/P2438R2#_modifying_existing_const_overload
PR c++/98939
PR libstdc++/119745
gcc/cp/ChangeLog:
* class.cc (object_parms_correspond): Allow differing
FUNCTION_REF_QUALIFIED in C++20.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/ref-qual5.C: Expect no diagnostics in C++20.
Reviewed-by: Jason Merrill <jason@redhat.com>
More information about the Gcc-bugs
mailing list