[Issue 22432] ImportC: casting result of postfix operator on a parenthesized expression to a typedef’d type is parsed incorrectly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 3 07:38:00 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22432

--- Comment #2 from dave287091 at gmail.com ---
(In reply to dave287091 from comment #1)
> Some more examples:
> 
>     int ints[] = {1,2,3,4};
>     int y0 = ints[0];
>     int y1 = (int)ints[0]; // ok
>     int y2 = (int)(ints)[0]; // ok
>     int y3 = (int32_t)ints[0]; // ok
>     int y4 = (int32_t)(ints)[0]; // Error
>     int y5 = (int)y4++; // ok
>     int y6 = (int)(y4)++; // Error
>     int y7 = (int32_t)y4++; // ok
>     int y8 = (int32_t)(y4)++; // Error
> 
> It looks like postfix expressions aren’t properly being considered for cast
> expressions.

Another one:     

int y4b = (int32_t)(ints+1)[0]; // Error

I’m guessing using `->` would also fail but I didn’t test it.

--


More information about the Digitalmars-d-bugs mailing list