Do not panic, when finding a typedef name, when an expression is expected.
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 4 Nov 2008 14:51:53 +0000 (14:51 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 4 Nov 2008 14:51:53 +0000 (14:51 +0000)
[r23433]

parser.c

index a808c1d..c1709fc 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -6604,6 +6604,11 @@ static expression_t *parse_reference(void)
                orig_type = entity->declaration.type;
        } else if (entity->kind == ENTITY_ENUM_VALUE) {
                orig_type = entity->enum_value.enum_type;
+       } else if (entity->kind == ENTITY_TYPEDEF) {
+               errorf(HERE, "encountered typedef name '%Y' while parsing expression",
+                       symbol);
+               next_token();
+               return create_invalid_expression();
        } else {
                panic("expected declaration or enum value in reference");
        }