re PR c++/27019 (ICE with designated initializers)
authorSteve Ellcey <sje@cup.hp.com>
Fri, 23 Jun 2006 21:53:36 +0000 (21:53 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Fri, 23 Jun 2006 21:53:36 +0000 (21:53 +0000)
PR c++/27019
* typeck2.c (process_init_constructor_array): Set ce->value on errors.

From-SVN: r114952

gcc/cp/ChangeLog
gcc/cp/typeck2.c

index 76ed3a0abba778f7f11e4f685b73d33faecd04eb..178b0af9cea7876be5d9418b58a65b0a7280aceb 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-23  Steve Ellcey  <sje@cup.hp.com>
+
+       PR c++/27019
+       * typeck2.c (process_init_constructor_array): Set ce->value on errors.
+
 2006-06-23  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/28112
index 6ad4e8347aab4aba060f6490a5962a3e55ac1534..bef448bbdf95ba4061cfa088cf556536bbbefa97 100644 (file)
@@ -797,7 +797,10 @@ process_init_constructor_array (tree type, tree init)
        {
          gcc_assert (TREE_CODE (ce->index) == INTEGER_CST);
          if (compare_tree_int (ce->index, i) != 0)
-           sorry ("non-trivial designated initializers not supported");
+           {
+             ce->value = error_mark_node;
+             sorry ("non-trivial designated initializers not supported");
+           }
        }
       else
        ce->index = size_int (i);
@@ -895,7 +898,10 @@ process_init_constructor_record (tree type, tree init)
                          || TREE_CODE (ce->index) == IDENTIFIER_NODE);
              if (ce->index != field
                  && ce->index != DECL_NAME (field))
-               sorry ("non-trivial designated initializers not supported");
+               {
+                 ce->value = error_mark_node;
+                 sorry ("non-trivial designated initializers not supported");
+               }
            }
 
          gcc_assert (ce->value);