https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109571
--- Comment #3 from Frank Heckenbach ---
Thanks for the explanation, that was really helpful.
If I understand it correctly, since B has a vtable and A doesn't, upcasting
means to add some offset to the pointer, but of course not if it's null. T
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109571
--- Comment #2 from Andrew Pinski ---
You get the same warning with:
struct A
{
int i = 0;
};
struct B: A
{
virtual ~B ();
};
int f(B *tmp)
{
A *a = tmp;
return a->i;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109571
Andrew Pinski changed:
What|Removed |Added
Component|c++ |tree-optimization
Keywords|