Set the result type of !, even if the operand type is not scalar.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 27 Aug 2008 09:07:41 +0000 (09:07 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 27 Aug 2008 09:07:41 +0000 (09:07 +0000)
[r21496]

parser.c

index c26ca18..b278121 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -6990,11 +6990,8 @@ static void semantic_not(unary_expression_t *expression)
 {
        type_t *const orig_type = expression->value->base.type;
        type_t *const type      = skip_typeref(orig_type);
-       if (!is_type_scalar(type)) {
-               if (is_type_valid(type)) {
-                       errorf(HERE, "operand of ! must be of scalar type");
-               }
-               return;
+       if (!is_type_scalar(type) && is_type_valid(type)) {
+               errorf(HERE, "operand of ! must be of scalar type");
        }
 
        expression->base.type = type_int;