This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: typeid strangeness
Ross Smith wrote:
> Did you forget to make _add_ref() virtual? If it's non-virtual, then the
> this pointer will have the static type of the caller (i.e. always
> ServantBase) instead of the dynamic type.
no, the method in question is virtual. In fact, I found out that passing
'*this' instead of 'this' to typeid() works, so I use that now. Still, I
can't believe the behavior for pointer types is correct.
Regards,
Stefan