This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29273] New: error on dynamic_cast<T>(array)
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Sep 2006 16:08:33 -0000
- Subject: [Bug c++/29273] New: error on dynamic_cast<T>(array)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Gcc gives an error for the dynamic_cast below. During the discussion of bug
29185 with EDG it turned out that according to 5, p8, the code is well-formed
and should not be diagnosed.
$ cat t.cpp && gcc t.cpp
struct A { virtual ~A () { } };
struct B: A { } b [1];
void foo ()
{
dynamic_cast<B*>(b);
}
t.cpp: In function 'void foo()':
t.cpp:6: error: cannot dynamic_cast 'b' (of type 'struct B [1]') to type
'struct B*' (source is not a pointer)
--
Summary: error on dynamic_cast<T>(array)
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sebor at roguewave dot com
GCC build triplet: all
GCC host triplet: all
GCC target triplet: all
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29273