(finish_enum): Handle VALUES being an ERROR_MARK.
From-SVN: r7303
This commit is contained in:
parent
005a35b93f
commit
59116212bf
|
@ -5642,6 +5642,9 @@ finish_enum (enumtype, values)
|
|||
|
||||
/* Calculate the maximum value of any enumerator in this type. */
|
||||
|
||||
if (values == error_mark_node)
|
||||
minnode = maxnode = integer_zero_node;
|
||||
else
|
||||
for (pair = values; pair; pair = TREE_CHAIN (pair))
|
||||
{
|
||||
tree value = TREE_VALUE (pair);
|
||||
|
@ -5700,6 +5703,8 @@ finish_enum (enumtype, values)
|
|||
/* An enum can have some negative values; then it is signed. */
|
||||
TREE_UNSIGNED (enumtype) = tree_int_cst_sgn (minnode) >= 0;
|
||||
|
||||
if (values != error_mark_node)
|
||||
{
|
||||
/* Change the type of the enumerators to be the enum type.
|
||||
Formerly this was done only for enums that fit in an int,
|
||||
but the comment said it was done only for enums wider than int.
|
||||
|
@ -5718,6 +5723,7 @@ finish_enum (enumtype, values)
|
|||
TREE_PURPOSE (pair) = DECL_NAME (TREE_PURPOSE (pair));
|
||||
|
||||
TYPE_VALUES (enumtype) = values;
|
||||
}
|
||||
|
||||
/* Fix up all variant types of this enum type. */
|
||||
for (tem = TYPE_MAIN_VARIANT (enumtype); tem; tem = TYPE_NEXT_VARIANT (tem))
|
||||
|
|
Loading…
Reference in New Issue