mirror of
https://github.com/frida/tinycc
synced 2024-11-24 00:29:38 +03:00
Make casts lose top-level qualifiers
TODO: also make them lose lvalue status
This commit is contained in:
parent
f85b1e393f
commit
c81116e29a
1
tccgen.c
1
tccgen.c
@ -2660,6 +2660,7 @@ static void gen_cast(CType *type)
|
||||
| (lvalue_type(type->ref->type.t) & VT_LVAL_TYPE);
|
||||
}
|
||||
vtop->type = *type;
|
||||
vtop->type.t &= ~ ( VT_CONSTANT | VT_VOLATILE | VT_ARRAY );
|
||||
}
|
||||
|
||||
/* return type size as known at compile time. Put alignment at 'a' */
|
||||
|
@ -74,5 +74,8 @@ int main()
|
||||
//should accept ({ }) in the controlling expr of _Generic even in const_wanted contexts
|
||||
struct { _Bool x_0: _Generic(({0;}),default:1); } my_x;
|
||||
|
||||
_Generic((__typeof((float const)((float const){42}))*){0}, float*: 0); //casts lose top-level qualifiers
|
||||
int const x = 42; __typeof((__typeof(x))x) *xp = 0; (void)_Generic(xp, int*: 0); //casts lose top-level qualifiers
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user