[cfe-dev] How to get expressions hiding in types?

Eli Friedman eli.friedman at gmail.com
Sat Apr 18 22:11:59 PDT 2009


On Sat, Apr 18, 2009 at 10:05 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Apr 18, 2009, at 9:57 PM, Eli Friedman wrote:
>
>> On Sat, Apr 18, 2009 at 4:10 PM, Chris Lattner <clattner at apple.com> wrote:
>>>
>>> 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?

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

-Eli




More information about the cfe-dev mailing list