This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15229] Omits constructor calls for variables not used otherwise.
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Apr 2004 17:22:01 -0000
- Subject: [Bug c++/15229] Omits constructor calls for variables not used otherwise.
- References: <20040430155448.15229.duz@sol-3.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-30 17:22 -------
Invalid, this code is equivent to this simplifed case:
struct Lingo
{
Lingo ();
};
struct ALingo : Lingo
{
ALingo();
};
int main()
{
ALingo a;
Lingo b(a); // <-- calls the copy constrctor
}
Since there is no user defined copy constructor, the compiler creates one for you (by the rules of C++).
So this is invalid, to solve this you need to define a copy constructor.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15229