Hi,
in this example
struct A
{
virtual ~A() {}
};
struct B
{
virtual ~B() {}
};
int main()
{
A* a(0);
dynamic_cast<B*>(a);
static_cast<B*>(a);
return 0;
}
the static_cast gives an error but the dynamic_cast not even a warning.
Cheers,
André
--
Summary: dynamic_cast should give a warning/error for non related
classes
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Woebbeking at web dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38557