(check_for_full_enumeration_handling): Handle nameless type.
From-SVN: r3516
This commit is contained in:
parent
b4e3b9e995
commit
3b24f55b09
12
gcc/stmt.c
12
gcc/stmt.c
|
@ -3602,12 +3602,18 @@ check_for_full_enumeration_handling (type)
|
|||
;
|
||||
|
||||
if (!chain)
|
||||
{
|
||||
if (TYPE_NAME (type) == 0)
|
||||
warning ("case value `%d' not in enumerated type",
|
||||
TREE_INT_CST_LOW (n->low));
|
||||
else
|
||||
warning ("case value `%d' not in enumerated type `%s'",
|
||||
TREE_INT_CST_LOW (n->low),
|
||||
IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
|
||||
== IDENTIFIER_NODE)
|
||||
? TYPE_NAME (type)
|
||||
: DECL_NAME (TYPE_NAME (type))));
|
||||
}
|
||||
if (!tree_int_cst_equal (n->low, n->high))
|
||||
{
|
||||
for (chain = TYPE_VALUES (type);
|
||||
|
@ -3616,6 +3622,11 @@ check_for_full_enumeration_handling (type)
|
|||
;
|
||||
|
||||
if (!chain)
|
||||
{
|
||||
if (TYPE_NAME (type) == 0)
|
||||
warning ("case value `%d' not in enumerated type",
|
||||
TREE_INT_CST_LOW (n->high));
|
||||
else
|
||||
warning ("case value `%d' not in enumerated type `%s'",
|
||||
TREE_INT_CST_LOW (n->high),
|
||||
IDENTIFIER_POINTER ((TREE_CODE (TYPE_NAME (type))
|
||||
|
@ -3624,6 +3635,7 @@ check_for_full_enumeration_handling (type)
|
|||
: DECL_NAME (TYPE_NAME (type))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If all values were found as case labels, make one of them the default
|
||||
label. Thus, this switch will never fall through. We arbitrarily pick
|
||||
|
|
Loading…
Reference in New Issue