]> gcc.gnu.org Git - gcc.git/commit
c++: Allow template rvalue-ref conv to bind to lvalue ref.
authorJason Merrill <jason@redhat.com>
Wed, 26 Feb 2020 05:33:52 +0000 (00:33 -0500)
committerJakub Jelinek <jakub@redhat.com>
Thu, 17 Sep 2020 15:39:46 +0000 (17:39 +0200)
commitfc7b9288e32e28c65db7825dfbaabce31a0d4a06
treef6be9d81e279bbe06412ee2aeb7fe713969da36c
parent2bcc7a4c0b59cd9ea67409942fb4317c22edff40
c++: Allow template rvalue-ref conv to bind to lvalue ref.

When I implemented the [over.match.ref] rule that a reference conversion
function needs to match l/rvalue of the target reference type it changed our
handling of this testcase.  It seems to me that our current behavior is what
the standard says, but it doesn't seem desirable, and all the other
compilers have our old behavior.  So let's limit the change to non-templates
until there's some clarification from the committee.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  <jason@redhat.com>

PR c++/90546
* call.c (build_user_type_conversion_1): Allow a template conversion
returning an rvalue reference to bind directly to an lvalue.
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp0x/rv-conv3.C [new file with mode: 0644]
This page took 0.064506 seconds and 6 git commands to generate.