https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69390

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-03-17
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |5.3.1, 6.3.0, 7.0

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with today's top of trunk (GCC 7.0), 6.x, and 5.x

$ cat t.C && gcc  -Wall -Wextra -Wpedantic t.C
struct A { virtual ~A() {}; };
struct B : A {} b;

void g ()
{
    A &&ar = static_cast<A&&>(b);
    B &&br = dynamic_cast<B&&>(ar);

    dynamic_cast<B&&>(static_cast<A&&>(b));
}
t.C: In function ‘void g()’:
t.C:9:23: error: conversion to non-const reference type ‘struct A&’ from rvalue
of type ‘A’ [-fpermissive]
     dynamic_cast<B&&>(static_cast<A&&>(b));
                       ^~~~~~~~~~~~~~~~~~~
t.C:7:9: warning: unused variable ‘br’ [-Wunused-variable]
     B &&br = dynamic_cast<B&&>(ar);
         ^~

Reply via email to