ast2firm: Implement casting from complex to real types.
[cparser] / ast.c
diff --git a/ast.c b/ast.c
index eda9b70..f852a9d 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1,21 +1,6 @@
 /*
  * This file is part of cparser.
- * Copyright (C) 2007-2009 Matthias Braun <matze@braunis.de>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * Copyright (C) 2012 Matthias Braun <matze@braunis.de>
  */
 #include <config.h>
 
@@ -599,6 +584,10 @@ static void print_designator(const designator_t *designator)
                if (designator->symbol == NULL) {
                        print_char('[');
                        print_expression(designator->array_index);
+                       if (designator->range_last) {
+                               print_string(" ... ");
+                               print_expression(designator->range_last);
+                       }
                        print_char(']');
                } else {
                        print_char('.');
@@ -1850,10 +1839,9 @@ check_type:
                return is_constant_expression(expression->unary.value);
        }
 
-
        case EXPR_UNARY_CAST: {
                type_t *const type = skip_typeref(expression->base.type);
-               if (is_type_scalar(type) || is_type_complex(type))
+               if (is_type_scalar(type))
                        return is_constant_expression(expression->unary.value);
                if (!is_type_valid(type))
                        return EXPR_CLASS_ERROR;