Correct logic in is_error_entity().
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 18 Feb 2011 21:05:10 +0000 (21:05 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 18 Feb 2011 21:05:10 +0000 (21:05 +0000)
This fixes C/should_fail/typedef_enum.c.

[r28418]

parser.c

index cd2f037..7e44886 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4110,9 +4110,9 @@ static void error_redefined_as_different_kind(const source_position_t *pos,
 static bool is_error_entity(entity_t *const ent)
 {
        if (is_declaration(ent)) {
-               return is_type_valid(skip_typeref(ent->declaration.type));
+               return !is_type_valid(skip_typeref(ent->declaration.type));
        } else if (ent->kind == ENTITY_TYPEDEF) {
-               return is_type_valid(skip_typeref(ent->typedefe.type));
+               return !is_type_valid(skip_typeref(ent->typedefe.type));
        }
        return false;
 }