[PATCH] Check dynamic_cast is not used with -fno-rtti

Arnaud A. de Grandmaison arnaud.adegm at gmail.com
Mon Jul 29 08:52:26 PDT 2013

Clang emits an error when typeid is used with -fno-rtti, but does not
perform a similar check for dynamic_cast.

The attached patch implements the check.

I have done it late in 'CastOperation::CheckDynamicCast' , as some
dynamic_cast can be resolved statically, and will thus require no
support from the runtime, but we may also want to be more paranoïd.

Any thoughts ?

Arnaud A. de Grandmaison

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Check-dynamic_cast-is-not-used-with-fno-rtti.patch
Type: text/x-patch
Size: 2151 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130729/9e077b5c/attachment.bin>

More information about the cfe-commits mailing list