Adapted tokens.inc for Cygwin and MinGW
[cparser] / parser.c
index 00a8ed4..598f61c 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -7874,9 +7874,10 @@ typeprop_expression:
        tp_expression->typeprop.type   = orig_type;
        type_t const* const type       = skip_typeref(orig_type);
        char   const* const wrong_type =
-               is_type_incomplete(type)    ? "incomplete"          :
-               type->kind == TYPE_FUNCTION ? "function designator" :
-               type->kind == TYPE_BITFIELD ? "bitfield"            :
+               GNU_MODE && is_type_atomic(type, ATOMIC_TYPE_VOID) ? NULL                  :
+               is_type_incomplete(type)                           ? "incomplete"          :
+               type->kind == TYPE_FUNCTION                        ? "function designator" :
+               type->kind == TYPE_BITFIELD                        ? "bitfield"            :
                NULL;
        if (wrong_type != NULL) {
                char const* const what = kind == EXPR_SIZEOF ? "sizeof" : "alignof";
@@ -8241,6 +8242,7 @@ static expression_t *parse_conditional_expression(expression_t *expression)
        }
        rem_anchor_token(':');
        expect(':', end_error);
+end_error:;
        expression_t *false_expression =
                parse_sub_expression(c_mode & _CXX ? PREC_ASSIGNMENT : PREC_CONDITIONAL);
 
@@ -8349,8 +8351,6 @@ static expression_t *parse_conditional_expression(expression_t *expression)
                = create_implicit_cast(false_expression, result_type);
        conditional->base.type = result_type;
        return result;
-end_error:
-       return create_invalid_expression();
 }
 
 /**