diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1993-09-11 13:06:48 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1993-09-11 13:06:48 -0700 |
commit | cc77d4d5c4cd4aec8810d5c3d21ea57b41bedc21 (patch) | |
tree | 432cffb6c9ec1792a1e9af3267dbe1a8a08035cc /gcc | |
parent | 92bd489fd642c8c11e6ceb53639eee58c4c939cd (diff) | |
download | gcc-cc77d4d5c4cd4aec8810d5c3d21ea57b41bedc21.zip gcc-cc77d4d5c4cd4aec8810d5c3d21ea57b41bedc21.tar.gz gcc-cc77d4d5c4cd4aec8810d5c3d21ea57b41bedc21.tar.bz2 |
New variable constructor_no_implicit, set by Chill front-end.
From-SVN: r5306
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index b833bcd..926d292 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -5105,6 +5105,9 @@ static tree constructor_pending_elts; /* The SPELLING_DEPTH of this constructor. */ static int constructor_depth; +/* 0 if implicitly pushing constructor levels is allowed. */ +int constructor_no_implicit = 0; /* 0 for C; 1 for some other languages. */ + /* 1 if this constructor level was entered implicitly. */ static int constructor_implicit; @@ -6127,7 +6130,7 @@ process_init_element (value) value = orig_value; /* Otherwise, if we have come to a subaggregate, and we don't have an element of its type, push into it. */ - else if (value != 0 + else if (value != 0 && !constructor_no_implicit && TYPE_MAIN_VARIANT (TREE_TYPE (value)) != fieldtype && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE || fieldcode == UNION_TYPE)) @@ -6184,7 +6187,7 @@ process_init_element (value) value = orig_value; /* Otherwise, if we have come to a subaggregate, and we don't have an element of its type, push into it. */ - else if (value != 0 + else if (value != 0 && !constructor_no_implicit && TYPE_MAIN_VARIANT (TREE_TYPE (value)) != fieldtype && (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE || fieldcode == UNION_TYPE)) @@ -6221,7 +6224,7 @@ process_init_element (value) value = orig_value; /* Otherwise, if we have come to a subaggregate, and we don't have an element of its type, push into it. */ - else if (value != 0 + else if (value != 0 && !constructor_no_implicit && TYPE_MAIN_VARIANT (TREE_TYPE (value)) != elttype && (eltcode == RECORD_TYPE || eltcode == ARRAY_TYPE || eltcode == UNION_TYPE)) |