diff options
| author | Michael Matz <matz@suse.de> | 2016-08-01 22:55:07 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-12-15 17:47:09 +0100 |
| commit | b7ca74577b56190954eb6eeda8c22996b877f3c5 (patch) | |
| tree | b613f1d6818e9b2fa89d632624228b3129111b8c /tccgen.c | |
| parent | 9e86ebee944e7fc480fe49bf4f4f406aab672200 (diff) | |
| download | tinycc-b7ca74577b56190954eb6eeda8c22996b877f3c5.tar.gz tinycc-b7ca74577b56190954eb6eeda8c22996b877f3c5.tar.bz2 | |
struct-init: Allow member initialization from qualified lvalues
See testcase.
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -6012,7 +6012,10 @@ static void decl_initializer(CType *type, Section *sec, unsigned long c, if (have_elem && !(type->t & VT_ARRAY) && - is_compatible_types(type, &vtop->type)) { + /* Use i_c_parameter_t, to strip toplevel qualifiers. + The source type might have VT_CONSTANT set, which is + of course assignable to a non-const elements. */ + is_compatible_parameter_types(type, &vtop->type)) { init_putv(type, sec, c); } else if (type->t & VT_ARRAY) { s = type->ref; |
