public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/100708] New: dynamic_cast can convert xvalue to lvalue
@ 2021-05-20 20:18 rs2740 at gmail dot com
2021-05-20 20:22 ` [Bug c++/100708] " redi at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: rs2740 at gmail dot com @ 2021-05-20 20:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100708
Bug ID: 100708
Summary: dynamic_cast can convert xvalue to lvalue
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rs2740 at gmail dot com
Target Milestone: ---
GCC accepts
struct A { virtual ~A() {}; };
struct B : A {} b;
void g ()
{
dynamic_cast<B&>(static_cast<A&&>(b));
}
[expr.dynamic.cast]/2 says that for dynamic_cast<T>(v):
If T is an lvalue reference type, v shall be an lvalue of a complete class
type, and the result is an lvalue of the type referred to by T.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-20 20:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 20:18 [Bug c++/100708] New: dynamic_cast can convert xvalue to lvalue rs2740 at gmail dot com
2021-05-20 20:22 ` [Bug c++/100708] " redi at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).