Fixed error message.
[cparser] / parser.c
index 46efabc..3c5383b 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2583,14 +2583,9 @@ static type_t *parse_typeof(void)
 
        expression_t *expression  = NULL;
 
-       bool old_type_prop     = in_type_prop;
-       bool old_gcc_extension = in_gcc_extension;
-       in_type_prop           = true;
+       bool old_type_prop = in_type_prop;
+       in_type_prop       = true;
 
-       while (next_if(T___extension__)) {
-               /* This can be a prefix to a typename or an expression. */
-               in_gcc_extension = true;
-       }
        switch (token.type) {
        case T_IDENTIFIER:
                if (is_typedef_symbol(token.symbol)) {
@@ -2603,8 +2598,7 @@ static type_t *parse_typeof(void)
                }
                break;
        }
-       in_type_prop     = old_type_prop;
-       in_gcc_extension = old_gcc_extension;
+       in_type_prop = old_type_prop;
 
        rem_anchor_token(')');
        expect(')', end_error);
@@ -2786,12 +2780,11 @@ static entity_t *create_error_entity(symbol_t *symbol, entity_kind_tag_t kind)
 
 static void parse_declaration_specifiers(declaration_specifiers_t *specifiers)
 {
-       type_t            *type              = NULL;
-       type_qualifiers_t  qualifiers        = TYPE_QUALIFIER_NONE;
-       unsigned           type_specifiers   = 0;
-       bool               newtype           = false;
-       bool               saw_error         = false;
-       bool               old_gcc_extension = in_gcc_extension;
+       type_t            *type            = NULL;
+       type_qualifiers_t  qualifiers      = TYPE_QUALIFIER_NONE;
+       unsigned           type_specifiers = 0;
+       bool               newtype         = false;
+       bool               saw_error       = false;
 
        memset(specifiers, 0, sizeof(*specifiers));
        specifiers->source_position = token.source_position;
@@ -2863,11 +2856,6 @@ wrong_thread_storage_class:
                MATCH_TYPE_QUALIFIER(T___uptr,   TYPE_QUALIFIER_UPTR);
                MATCH_TYPE_QUALIFIER(T___sptr,   TYPE_QUALIFIER_SPTR);
 
-               case T___extension__:
-                       next_token();
-                       in_gcc_extension = true;
-                       break;
-
                /* type specifiers */
 #define MATCH_SPECIFIER(token, specifier, name)                         \
                case token:                                                     \
@@ -3018,8 +3006,6 @@ wrong_thread_storage_class:
 finish_specifiers:
        specifiers->attributes = parse_attributes(specifiers->attributes);
 
-       in_gcc_extension = old_gcc_extension;
-
        if (type == NULL || (saw_error && type_specifiers != 0)) {
                atomic_type_kind_t atomic_type;
 
@@ -3332,7 +3318,6 @@ static void parse_parameters(function_type_t *type, scope_t *scope)
                                goto parameters_finished;
 
                        case T_IDENTIFIER:
-                       case T___extension__:
                        DECLARATION_START
                        {
                                entity_t *entity = parse_parameter();
@@ -4557,7 +4542,6 @@ static void parse_kr_declaration_list(entity_t *entity)
        for (;;) {
                switch (token.type) {
                        DECLARATION_START
-                       case T___extension__:
                        /* This covers symbols, which are no type, too, and results in
                         * better error messages.  The typical cases are misspelled type
                         * names and missing includes. */