This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug in use of base class constructor in inherited class ?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Nilmoni Deb <ndeb at ece dot cmu dot edu>
- Cc: gcc-bugs at gcc dot gnu dot org, Andrew Pinski <pinskia at physics dot uc dot edu>
- Date: Tue, 13 Apr 2004 21:06:03 -0400
- Subject: Re: Bug in use of base class constructor in inherited class ?
- References: <Pine.LNX.4.53L-ECE.CMU.EDU.0404132018550.27793@frodo.ece.cmu.edu>
This is not a bug and here is why:
obj2(int a) { obj(a); } // overloaded constructor
what this really is obj a; and not calling of the constructor.
try this instead:
obj2(int a): obj (a) {}
Thanks,
Andrew Pinski