[Bug c++/69390] dynamic_cast on rvalue fails

2017-03-17 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69390

Martin Sebor  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  ---
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 & = static_cast(b);
B & = dynamic_cast(ar);

dynamic_cast(static_cast(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(static_cast(b));
   ^~~
t.C:7:9: warning: unused variable ‘br’ [-Wunused-variable]
 B & = dynamic_cast(ar);
 ^~

[Bug c++/69390] dynamic_cast on rvalue fails

2016-08-08 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69390

--- Comment #2 from Andrew Pinski  ---
Related to bug 69060.

[Bug c++/69390] dynamic_cast on rvalue fails

2016-01-20 Thread kyle.strand at beckman dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69390

Kyle J Strand  changed:

   What|Removed |Added

 CC||kyle.strand at beckman dot com

--- Comment #1 from Kyle J Strand  ---
See http://stackoverflow.com/q/34901154/1858225. According to comments Clang
accepts this code.