Re: building gcc4... HELP!
Re: building gcc4... HELP!
- Subject: Re: building gcc4... HELP!
- From: Hugh Hoover <email@hidden>
- Date: Tue, 10 May 2005 20:53:35 -0700
On May 10, 2005, at 17:03, David Leimbach wrote:
On 5/9/05, Hugh Hoover <email@hidden> wrote:
Hi - I found a bug in the libc++v3 library with dynamic_cast and,
rather than just wait for Apple to fix it, I'm trying to build my own
so I can fix it myself as a work-around.
What's the bug?
If you have a template class that uses a base class with virtual
functions AND you have ANOTHER template that accepts the base class
and does a dynamic_cast to the template class AND you're using dylibs
or frameworks or.. (any separately linked form that might generate a
local copy of the template), then the dynamic_cast will fail in any
module other than the one that actually creates the object.
This is because a new instance of the type_info is created for each
module that has it's own instantiation of the template, and the
dynamic_cast code (apparently) does not perform a normalized (non-
instance-specific) comparison between the source and destination types.
Was that as clear as mud? :) see my message in xcode-
email@hidden on may 9 with the subject "bug?: templates,
dynamic_cast and frameworks". It's slightly more clear. I also have
a very short example that shows the problem in about 100 lines of code.
I think now that I can work around the issue by only having a single
instantiation of any template (-no-implicit-templates), but that's
likely to be painful in the extreme. I'd rather have a proper
dynamic_cast that doesn't depend on specific instances of type_info.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden