https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69390
Bug ID: 69390 Summary: dynamic_cast on rvalue fails Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: colu...@gmx-topmail.de Target Milestone: --- The following code spuriously fails, because a "conversion to non-const reference type 'struct main()::A&' from rvalue of type 'main()::A'" is necessitated: ----- int main(){ struct A { virtual ~A() {}; }; struct B : A {} b; dynamic_cast<B&&>(static_cast<A&&>(b)); }