This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [C++] fwd: PR 11895


I am forwarding this patch from the PR, I think it is correct and
no one has looked at the patch yet.
Bootstrapped on powerpc-apple-darwin7.2.0 with no regressions.
OK?


This patch seems to fix the problem, though I admit it may not be the optimal way to fix it.


2003-08-26 Fred Fish <fnf@intrinsity.com>


	* decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE,
	except don't call array_type_nelts() with a VECTOR_TYPE.

Index: decl.c
===================================================================
RCS file: /mips/newtools/fsf/gcc/gcc/cp/decl.c,v
retrieving revision 1.16
diff -c -p -r1.16 decl.c
*** decl.c	2003/08/25 19:56:29	1.16
--- decl.c	2003/08/26 16:39:31
*************** reshape_init (tree type, tree *initp)
*** 7593,7606 ****
  		}
  	    }
  	}
!       else if (TREE_CODE (type) == ARRAY_TYPE)
  	{
  	  tree index;
  	  tree max_index;

/* If the bound of the array is known, take no more initializers
than are allowed. */
! max_index = (TYPE_DOMAIN (type)
? array_type_nelts (type) : NULL_TREE);
/* Loop through the array elements, gathering initializers. */
for (index = size_zero_node;
--- 7593,7606 ----
}
}
}
! else if ((TREE_CODE (type) == ARRAY_TYPE) || (TREE_CODE (type) == VECTOR_TYPE))
{
tree index;
tree max_index;


/* If the bound of the array is known, take no more initializers
than are allowed. */
! max_index = ((TYPE_DOMAIN (type) && (TREE_CODE (type) == ARRAY_TYPE))
? array_type_nelts (type) : NULL_TREE);
/* Loop through the array elements, gathering initializers. */
for (index = size_zero_node;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]