[cfe-dev] [patch] const_cast semantic analysis

Sebastian Redl sebastian.redl at getdesigned.at
Fri Sep 26 12:04:31 PDT 2008


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


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

More information about the cfe-dev mailing list