[cfe-commits] Better const_cast support
sebastian.redl at getdesigned.at
Sat Sep 27 05:47:09 CDT 2008
Eli Friedman wrote:
> On Fri, Sep 26, 2008 at 3:10 PM, Sebastian Redl
> <sebastian.redl at getdesigned.at> wrote:
>> What it does not support is array decay. This fails:
>> const int ar;
>> int *pi = const_cast<int*>(ar);
>> This is because lvalue-to-rvalue conversion is not performed on the argument
>> (would lead to array decay). Is a generic facility for this in the semantic
>> checker somewhere? It's really indispensable for C++ semantic checking.
> Sema::DefaultFunctionArrayConversion should do what you want in the
> cases where the destination type isn't a reference type.
Thank you. Now the array decay line is correctly supported and no longer
fails. I think this patch is therefore complete.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the cfe-commits