Do not generate an error message about incompatible types in ?: if the error type...
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 19 Oct 2008 16:49:14 +0000 (16:49 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 19 Oct 2008 16:49:14 +0000 (16:49 +0000)
[r23014]

parser.c

index 7526065..6ebfe2e 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -7380,7 +7380,7 @@ static expression_t *parse_conditional_expression(unsigned precedence,
                        warningf(&conditional->base.source_position,
                                        "pointer/integer type mismatch in conditional expression ('%T' and '%T')", true_type, false_type);
                        result_type = pointer_type;
-               } else {
+               } else if (is_type_valid(other_type)) {
                        type_error_incompatible("while parsing conditional",
                                        &expression->base.source_position, true_type, false_type);
                        result_type = type_error_type;