C++ PATCH for c++/54341, c++/54253 (constexpr and virtual functions)

Matthias Klose doko@ubuntu.com
Fri Sep 7 16:36:00 GMT 2012


On 06.09.2012 17:37, Jason Merrill wrote:
> Vtables were causing several different problems for constexpr:
> 
> 1) Value-initializing a nearly-empty class (that has a vptr but no data) meant
> two initializers for a single base.  Fixed by not bothering to zero out a type
> with no data before calling its constructor.
> 
> 2) A primary base is allocated at offset 0 even if it isn't at the beginning of
> the base-clause, but constructors initialize bases in the order of the
> base-clause.  So we need to do some adjustment to get our CONSTRUCTOR in the
> right order.
> 
> Looking at issue 2 also led me to notice that we were failing to ignore base
> fields as intended in cx_check_missing_mem_inits.

thanks for the fix. looked at backporting this for 4.7. Is it really necessary
to use C++ only syntax for this kind of patches, which are a candidate for 4.7?

thanks, Matthias



More information about the Gcc-patches mailing list