[Bug c++/54740] Empty base optimization gets confused when a member variable derives from the same empty base.

avenikov at google dot com gcc-bugzilla@gcc.gnu.org
Sat Sep 29 00:10:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54740

--- Comment #3 from Andy Venikov <avenikov at google dot com> 2012-09-29 00:09:55 UTC ---
(In reply to comment #2)
> (In reply to comment #1)
> > No they shouldn't. The standard requires this to pass:
> > 
> >   outer o;
> >   assert( static_cast<inner*>(&o) != &o.i_ );
> 
> Oops, that should be:
> 
>    assert( static_cast<empty_base*>(&o) != &o.i_ );

I see.
I was aware of the rule you mentioned, but it was hard to see how it could
apply here.
Sorry for the noise then.



More information about the Gcc-bugs mailing list