Commit 59116212 by Richard Kenner

(finish_enum): Handle VALUES being an ERROR_MARK.

From-SVN: r7303
parent 005a35b9
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment