This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52327] Virtual inheritance and template copy construction doesn't call the correct copy constructors
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Feb 2012 17:04:06 +0000
- Subject: [Bug c++/52327] Virtual inheritance and template copy construction doesn't call the correct copy constructors
- Auto-submitted: auto-generated
- References: <bug-52327-4@http.gcc.gnu.org/bugzilla/>
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