fix for cp_error062
authorMatthias Braun <matze@braunis.de>
Wed, 5 May 2010 09:09:25 +0000 (09:09 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 5 May 2010 09:09:25 +0000 (09:09 +0000)
[r27485]

ast.c
type.c

diff --git a/ast.c b/ast.c
index fa3cd71..66ff84f 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1840,7 +1840,7 @@ bool is_constant_expression(const expression_t *expression)
 
        case EXPR_UNARY_CAST:
        case EXPR_UNARY_CAST_IMPLICIT:
-               return is_type_arithmetic(skip_typeref(expression->base.type))
+               return is_type_scalar(skip_typeref(expression->base.type))
                        && is_constant_expression(expression->unary.value);
 
        case EXPR_BINARY_ADD:
diff --git a/type.c b/type.c
index 27ec551..f36d446 100644 (file)
--- a/type.c
+++ b/type.c
@@ -1009,9 +1009,9 @@ bool is_type_scalar(const type_t *type)
        assert(!is_typeref(type));
 
        switch (type->kind) {
-               case TYPE_POINTER: return true;
-               case TYPE_BUILTIN: return is_type_scalar(type->builtin.real_type);
-               default:           break;
+       case TYPE_POINTER: return true;
+       case TYPE_BUILTIN: return is_type_scalar(type->builtin.real_type);
+       default:           break;
        }
 
        return is_type_arithmetic(type);