[cfe-commits] Better const_cast support

Sebastian Redl sebastian.redl at getdesigned.at
Fri Sep 26 08:26:09 PDT 2008


Hi,

The attached patch adds validation to const_cast, to ensure that it only 
performs casts that the standard allows. With this, const_cast is 
compliant except that it does not reject pointers to (member) functions yet.

Piggybacking are a comment change where a standard reference incorrectly 
says C99 instead of C++ and a correction of an assertion that contained 
a tautological condition.

Next I'll take a closer look at the beast that makes
int i;
const int &ri = i;
fail to compile :-)

Sebastian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: const_cast.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20080926/66a37b70/attachment.ksh>


More information about the cfe-commits mailing list