From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Seefeld To: Ross Smith Cc: gcc@gcc.gnu.org Subject: Re: typeid strangeness Date: Tue, 17 Jul 2001 18:34:00 -0000 Message-id: <3B54F529.7020006@sympatico.ca> References: <3B54E701.7030307@sympatico.ca> <3B54E442.2FE9EEE8@ihug.co.nz> X-SW-Source: 2001-07/msg01243.html 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