[cfe-dev] MSVC RTTI implementation status

David Blaikie dblaikie at gmail.com
Mon Feb 24 08:35:58 PST 2014


On Mon, Feb 24, 2014 at 1:31 AM, Domagoj Saric <
domagoj.saric at littleendian.com> wrote:

> On 24.2.2014. 7:53, David Majnemer wrote:
>
>> I don't think it would be unreasonable for us to maintain a list of
>> things we do
>> and do not claim to support.
>>
>
> FWIW, MSVC's RTTI implementation has one nice property (which I'd like if
> Clang could also 'emulate'): it (dynamic_cast) does not crash on objects
> w/o an RTTI record (while Clang under OSX always crashed for me in those
> cases).
> Such a case, for example, often arises if you use a (lame) GUI library
> which requires RTTI (because it relies on dynamic_cast and cross-casting)
> so you enable RTTI for its sources but disable it for others/your own
> sources (in order to minimize bloat and the leaking of internal
> implementation details as plain text in the final binary). Then when the
> GUI lib calls dynamic_cast on one of your own objects (because you, for
> example, added it to some widget container) it will simply get a nullptr
> result with MSVC (while, as I mentioned, you'll get a crash with Clang)...


Are you suggesting Clang crashes, or Clang produces a program that crashes?

In any case, I don't think either would be intended - you should either get
a compile-time error (because the type isn't dynamic) or a runtime check
(null or non-null, not a crash).


>
>
>
>
> --
> Domagoj Saric
> Software Architect
> www.LittleEndian.com
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140224/e7218587/attachment.html>


More information about the cfe-dev mailing list