Fix cast to rvalue reference from prvalue.
commite7c3e8af55abdb865e31fe04cf4fae8d72a2bc7f
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 May 2018 17:21:39 +0000 (23 17:21 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 May 2018 17:21:39 +0000 (23 17:21 +0000)
tree5bd0c1d1ac2778a2a49fe517118ceedcc7b8c77a
parent3f5730c25645fe40e93d74329f02e087eaa93746
Fix cast to rvalue reference from prvalue.

* cvt.c (diagnose_ref_binding): Handle rvalue reference.
* rtti.c (build_dynamic_cast_1): Don't try to build a reference to
non-class type.  Handle xvalue argument.
* typeck.c (build_reinterpret_cast_1): Allow cast from prvalue to
rvalue reference.
* semantics.c (finish_compound_literal): Do direct-initialization,
not cast, to initialize a reference.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260622 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cvt.c
gcc/cp/rtti.c
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/g++.dg/cpp0x/rv-cast6.C [new file with mode: 0644]