Create AST for select expressions even if the LHS has incomplete type.
[cparser] / parser.c
index d25c44f..3c10013 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4032,8 +4032,10 @@ static construct_type_t *parse_inner_declarator(declaration_t *declaration,
                next_token();
                add_anchor_token(')');
                inner_types = parse_inner_declarator(declaration, may_be_abstract);
-               /* All later declarators only modify the return type, not declaration */
-               declaration = NULL;
+               if (inner_types != NULL) {
+                       /* All later declarators only modify the return type, not declaration */
+                       declaration = NULL;
+               }
                rem_anchor_token(')');
                expect(')');
                break;
@@ -6990,7 +6992,7 @@ static expression_t *parse_select_expression(unsigned precedence,
                if (!declaration->init.complete) {
                        errorf(HERE, "request for member '%Y' of incomplete type '%T'",
                               symbol, type_left);
-                       return create_invalid_expression();
+                       goto create_error_entry;
                }
 
                entry = find_compound_entry(declaration, symbol);