Unified · Split
| @@ -2660,6 +2660,7 @@ static void gen_cast(CType *type) · 2659 unmodified lines | ||
| 2660 | 2660 | | (lvalue_type(type->ref->type.t) & VT_LVAL_TYPE); |
| 2661 | 2661 | } |
| 2662 | 2662 | vtop->type = *type; |
| 2663 | + vtop->type.t &= ~ ( VT_CONSTANT | VT_VOLATILE | VT_ARRAY ); | |
| 2663 | 2664 | } |
| 2664 | 2665 | |
| 2665 | 2666 | /* return type size as known at compile time. Put alignment at 'a' */ |
| @@ -74,5 +74,8 @@ int main() · 73 unmodified lines | ||
| 74 | 74 | //should accept ({ }) in the controlling expr of _Generic even in const_wanted contexts |
| 75 | 75 | struct { _Bool x_0: _Generic(({0;}),default:1); } my_x; |
| 76 | 76 | |
| 77 | + _Generic((__typeof((float const)((float const){42}))*){0}, float*: 0); //casts lose top-level qualifiers | |
| 78 | + int const x = 42; __typeof((__typeof(x))x) *xp = 0; (void)_Generic(xp, int*: 0); //casts lose top-level qualifiers | |
| 79 | + | |
| 77 | 80 | return 0; |
| 78 | 81 | } |