How to get expressions hiding in types?

Hi All,

How do I find expressions hiding in the vla sizes of types? I see that the stmt dumper doesn't walk into them with child iterators either.

I need this to implement checks for these cases:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090413/015827.html

Thanks,

-Chris

The problem isn't limited to VLAs... consider something like
"L:;static int a[1 || ({goto L; 0})];".

Perhaps we should just make gotos in statement expressions illegal, at
least for the moment?

-Eli

How do I find expressions hiding in the vla sizes of types? I see
that the stmt dumper doesn't walk into them with child iterators either.

I need this to implement checks for these cases:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090413/015827.html

The problem isn't limited to VLAs... consider something like
"L:;static int a[1 || ({goto L; 0})];".

Ok, what even happens to that expression? Do we just drop it on the floor?

Perhaps we should just make gotos in statement expressions illegal, at
least for the moment?

That's fine with me, but it doesn't directly help here: I still need some way to diagnose that a label was declared in the stmt expression.

-Chris

Yes; the type of the array gets "fixed" to int[1], so there isn't any
place to keep the expression.

-Eli

Gross. GCC allows gotos within statement expressions, just not out of them. We'd need to do something akin to jump tracking just to detect this case.

-Chris