https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98440
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |10.1.0, 11.0, 9.2.0
Target Milestone|--- |9.4
Summary|Accepts ill-formed |[9/10/11 Regression]
|reinterpret_cast<int&&>(1) |Accepts ill-formed
| |reinterpret_cast<int&&>(1)
CC| |jason at gcc dot gnu.org
Known to work| |8.3.0
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This was correctly rejected until r260622:
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.