[Bug c++/15229] Omits constructor calls for variables not used otherwise.
pinskia at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Apr 30 18:14:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list