[cfe-dev] MSVC RTTI implementation status

Domagoj Saric domagoj.saric at littleendian.com
Mon Feb 24 01:31:44 PST 2014


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)...



-- 
Domagoj Saric
Software Architect
www.LittleEndian.com



More information about the cfe-dev mailing list