[Bug c++/120529] __reference_{converts,constructs}_from_temporary ignore access control
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 21 14:17:12 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120529
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:e82a8e51848b5a74edb530f7597861f7080662c3
commit r16-5489-ge82a8e51848b5a74edb530f7597861f7080662c3
Author: Marek Polacek <polacek@redhat.com>
Date: Thu Nov 20 13:57:43 2025 -0500
c++: make __reference_*_from_temporary honor access [PR120529]
This PR reports that our __reference_*_from_temporary ignore access
control. The reason is that we only check if implicit_conversion
works, but not if the conversion can actually be performed, via
convert_like.
PR c++/120529
gcc/cp/ChangeLog:
* call.cc (ref_conv_binds_to_temporary): Don't ignore access
control.
gcc/testsuite/ChangeLog:
* g++.dg/ext/reference_xes_from_temporary1.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
More information about the Gcc-bugs
mailing list