Fix cast to rvalue reference from prvalue.
authorJason Merrill <jason@redhat.com>
Wed, 23 May 2018 17:21:39 +0000 (13:21 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 23 May 2018 17:21:39 +0000 (13:21 -0400)
commita347241b939399be041672fa6dfbc6c8c1853e28
tree5bd0c1d1ac2778a2a49fe517118ceedcc7b8c77a
parent955da5e5443724cb59f8fbd854c13e78c68bf000
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.

From-SVN: r260622
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]