[cfe-dev] Repeated expression in AST
Abramo Bagnara
abramo.bagnara at gmail.com
Fri Jan 6 04:38:15 PST 2012
Il 05/01/2012 14:40, Enea Zaffanella ha scritto:
> Please find attached a patch for review that, among other things, should
> fix the issue reported by Abramo in the mail below:
>
> Il 11/12/2011 11:13, Abramo Bagnara ha scritto:
>>
>> The typescript above shows that clang put *two* references to the same
>> expr in the AST (one as TypeOfExprType argument and another as
>> CompoundStmt child).
>>
>> This leads to shown wrong warning and (I guess) to other problems.
>>
>> Is it expected?
>>
>> $ cat bug.c
>> int f(int);
>> void h() {
>> __typeof(*(int (*)[f(1)]) 0) x;
>> }
I believe that the patch does the right thing with TypeOfExpr and indeed
fix the wrong code generation (while it fixes also the reported
duplicated presence of expr in AST and the bogus warning).
If there are no objections I will commit it.
More information about the cfe-dev
mailing list