Do not print an error, that the operand of delete does not have pointer type, if...
authorChristoph Mallon <christoph.mallon@gmx.de>
Thu, 11 Dec 2008 09:27:54 +0000 (09:27 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Thu, 11 Dec 2008 09:27:54 +0000 (09:27 +0000)
[r24511]

parser.c

index b1dfc6b..c5d3dd8 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -8434,8 +8434,10 @@ end_error:;
 
        type_t *const type = skip_typeref(value->base.type);
        if (!is_type_pointer(type)) {
-               errorf(&value->base.source_position,
-                               "operand of delete must have pointer type");
+               if (is_type_valid(type)) {
+                       errorf(&value->base.source_position,
+                                       "operand of delete must have pointer type");
+               }
        } else if (warning.other &&
                        is_type_atomic(skip_typeref(type->pointer.points_to), ATOMIC_TYPE_VOID)) {
                warningf(&value->base.source_position,