This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Recompiling troubles.... Was Re: Strange behaviour in C++...
- To: d92-foh at nada dot kth dot se
- Subject: Re: Recompiling troubles.... Was Re: Strange behaviour in C++...
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Tue, 31 Aug 1999 11:07:21 +0200
- CC: gcc at gcc dot gnu dot org
- References: <Pine.GSO.3.95.990831092817.21493A-100000@mumrik.nada.kth.se>
[calling virtual functions in destructors]
> Hmmm, I am not calling any virtual functions in destructors. I assume
> you meant constructors.
Yes, either constructors, or destructors.
> Anyway, that is not an option. I use CORBA which means a lot of
> abstract (virtual) base classes that defines interfaces. The cast to
> an interface class is not done by me but implicitly when I call
> another method which only takes a pointer to such an interface as an
> argument.
There is no problem with casting to a virtual base. The problem only
shows up when this virtual base pointer is used to invoke a virtual
function, and this call, directly or indirectly, appears in the
constructor of the derived class.
Since it is you who writes the constructor of the derived class, it
seems that you can control very well what you are calling.
Regards,
Martin