[patch] const_cast semantic analysis

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

Sebastian

const_cast.patch (8.36 KB)