[cfe-dev] [cfe-commits] Fix of syntactic InitListExpr with constructor initialization
Sebastian Redl
sebastian.redl at getdesigned.at
Fri Dec 16 10:35:14 PST 2011
On 16.12.2011, at 16:32, Nicola Gigante wrote:
>
> Hello.
>
> Consider this piece of code:
>
> struct S {
> S(int);
> };
>
> void func() {
> int a[] = { [0 ... 2] = 3.0 };
> S s[] = { [0 ... 2] = 3 };
> }
>
> In the first case (int array), the syntactic form of the InitListExpr
> node contains the ImplicitCastExpr that builds the initialization
> of the designator subobjects, while in the second case, the
> syntactic form contains only the IntegerLiteral, without all the
> implicit casts and CXXConstructExpr.
>
> This inconsistency makes the code of some clients more
> complicated than needed.
>
> Here is a patch that fixes this behaviour. It passes all the tests.
> If you think it's ok, I'll commit it.
>
Looks basically good to me, but I would appreciate a comment that describes what exactly the whole "LastCheckedObject" thing does.
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111216/57198514/attachment.html>
More information about the cfe-dev
mailing list