This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g++ and aliasing bools



> > The basic argument is this: I am allowed to implement C++ in a way that
> > zero-sized classes don't exist (they always come out as at least one
> > byte).  For such implementations I can clearly use the C rules, as there
> > is an equivalent C program.  If I then replace the inefficient
> 
> [Implicitly, we're still in the simple_enough case here, i.e., no virtuals,
> etc.  Perhaps the argument applies more generally, but we don't know yet.]

> OK, you've convinced me to extend simple_enough to the cases with
> zero-sized thingies, so long as the other conditions still hold.

We can handle inheritance as well if the zero-sized object is OK, since
the C translation is to make the base class look like a member of the
derived class.  This will allow us to do better on most STL iterators;
many are derived classes but they have no virtual functions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]