This is the mail archive of the gcc-bugs@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]

[Bug c++/52327] Virtual inheritance and template copy construction doesn't call the correct copy constructors


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-02-21 17:04:06 UTC ---
To quote the standard, [class.base.init] p7 says
"A mem-initializer where the mem-initializer-id denotes a virtual base class is
ignored during execution of a constructor of any class that is not the most
derived class."

So when Top is not the most-derived class, the mem-initializers in Top's copy
constructor are ignored, and the virtual bases get default-constructed.

c.f. http://www.parashift.com/c++-faq/multiple-inheritance.html#faq-25.12


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