This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in use of base class constructor in inherited class ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]