This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67557] Calling copy constructor of base class in constructor of derived class produces crashing code
- From: "Georg.Baum at post dot rwth-aachen.de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Sep 2015 10:34:48 +0000
- Subject: [Bug c++/67557] Calling copy constructor of base class in constructor of derived class produces crashing code
- Auto-submitted: auto-generated
- References: <bug-67557-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67557
--- Comment #6 from Georg Baum <Georg.Baum at post dot rwth-aachen.de> ---
(In reply to Markus Trippelsdorf from comment #4)
> Well, the automatically generated copy constructor is a (special) member
> function.
OK, I see what you mean, but I still do not understand. The automatically
generated default constructor is a special member function as well. Yet calling
it (implicitly by the compiler or explicitly by the programmer in the
initializer list) from a constructor of a derived class is legal. Also,
explicitly calling user defined constructors like in
FontTag::FontTag() : StartTag("") {}
is legal as well (at least this is my understanding and I have seen this many
times in existing code). What is special about a copy constructor that makes
Â12.6.2 - 14 apply to it but not to other constructors?