]> gcc.gnu.org Git - gcc.git/commit
c++: binding reference to comma expr [PR114561]
authorJason Merrill <jason@redhat.com>
Tue, 2 Apr 2024 14:52:28 +0000 (10:52 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 24 May 2024 13:26:35 +0000 (09:26 -0400)
commit7076c565e22281e193aeafafbf40676426a64b75
tree325ee6cd97e8e44629be1cc9c211deef72405c92
parenta1ff3171c3b8d1d13e241fde28a84ae11c10bd87
c++: binding reference to comma expr [PR114561]

We represent a reference binding where the referent type is more qualified
by a ck_ref_bind around a ck_qual.  We performed the ck_qual and then tried
to undo it with STRIP_NOPS, but that doesn't work if the conversion is
buried in COMPOUND_EXPR.  So instead let's avoid performing that fake
conversion in the first place.

PR c++/114561
PR c++/114562

gcc/cp/ChangeLog:

* call.cc (convert_like_internal): Avoid adding qualification
conversion in direct reference binding.

gcc/testsuite/ChangeLog:

* g++.dg/conversion/ref10.C: New test.
* g++.dg/conversion/ref11.C: New test.

(cherry picked from commit 5d7e9a35024f065b25f61747859c7cb7a770c92b)
gcc/cp/call.cc
gcc/testsuite/g++.dg/conversion/ref10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/conversion/ref11.C [new file with mode: 0644]
This page took 0.057304 seconds and 5 git commands to generate.