aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-01-05 15:22:38 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2005-01-05 15:22:38 +0000
commit0953878d4847146508dc49a4681bf56bde831d12 (patch)
tree5d187034169ae334fd9db4506ff30f71a331b03a
parentcf99f196e2e18b62becbb660761fc2a586b85d78 (diff)
downloadgcc-0953878d4847146508dc49a4681bf56bde831d12.zip
gcc-0953878d4847146508dc49a4681bf56bde831d12.tar.gz
gcc-0953878d4847146508dc49a4681bf56bde831d12.tar.bz2
c-typeck.c (constructor_no_implicit): Remove.
* c-typeck.c (constructor_no_implicit): Remove. (set_designator, process_init_element): Don't check constructor_no_implicit. From-SVN: r92951
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-typeck.c19
2 files changed, 11 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fb4d6f9..428d578 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-05 Joseph S. Myers <joseph@codesourcery.com>
+
+ * c-typeck.c (constructor_no_implicit): Remove.
+ (set_designator, process_init_element): Don't check
+ constructor_no_implicit.
+
2005-01-05 J"orn Rennecke <joern.rennecke@st.com>
Kaz Kojima <kkojima@gcc.gnu.org>
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 5eae3aa..e173c6a 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1,6 +1,6 @@
/* Build expressions with type checking for C compiler.
- Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GCC.
@@ -4353,9 +4353,6 @@ static struct init_node *constructor_pending_elts;
/* The SPELLING_DEPTH of this constructor. */
static int constructor_depth;
-/* 0 if implicitly pushing constructor levels is allowed. */
-int constructor_no_implicit = 0; /* 0 for C; 1 for some other languages. */
-
/* DECL node for which an initializer is being read.
0 means we are reading a constructor expression
such as (struct foo) {...}. */
@@ -5026,12 +5023,6 @@ set_designator (int array)
return 0;
}
- if (constructor_no_implicit)
- {
- error_init ("initialization designators may not nest");
- return 1;
- }
-
switch (TREE_CODE (constructor_type))
{
case RECORD_TYPE:
@@ -6002,7 +5993,7 @@ process_init_element (struct c_expr value)
value.value = orig_value;
/* Otherwise, if we have come to a subaggregate,
and we don't have an element of its type, push into it. */
- else if (value.value != 0 && !constructor_no_implicit
+ else if (value.value != 0
&& value.value != error_mark_node
&& TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype
&& (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE
@@ -6090,7 +6081,7 @@ process_init_element (struct c_expr value)
value.value = orig_value;
/* Otherwise, if we have come to a subaggregate,
and we don't have an element of its type, push into it. */
- else if (value.value != 0 && !constructor_no_implicit
+ else if (value.value != 0
&& value.value != error_mark_node
&& TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != fieldtype
&& (fieldcode == RECORD_TYPE || fieldcode == ARRAY_TYPE
@@ -6130,7 +6121,7 @@ process_init_element (struct c_expr value)
value.value = orig_value;
/* Otherwise, if we have come to a subaggregate,
and we don't have an element of its type, push into it. */
- else if (value.value != 0 && !constructor_no_implicit
+ else if (value.value != 0
&& value.value != error_mark_node
&& TYPE_MAIN_VARIANT (TREE_TYPE (value.value)) != elttype
&& (eltcode == RECORD_TYPE || eltcode == ARRAY_TYPE