[applied] C++ patch to fix arrays of vectors
Mark Mitchell
mark@codesourcery.com
Thu Jun 5 01:21:00 GMT 2003
> *************** reshape_init (tree type, tree *initp)
> *** 7483,7490 ****
> non-empty subaggregate, brace elision is assumed and the
> initializer is considered for the initialization of the first
> member of the subaggregate. */
> ! if (CLASS_TYPE_P (type)
> ! && !brace_enclosed_p
> && can_convert_arg (type, TREE_TYPE (old_init_value),
> old_init_value))
> {
> *initp = TREE_CHAIN (old_init);
> --- 7484,7490 ----
> non-empty subaggregate, brace elision is assumed and the
> initializer is considered for the initialization of the first
> member of the subaggregate. */
> ! if (!brace_enclosed_p
> && can_convert_arg (type, TREE_TYPE (old_init_value),
> old_init_value))
> {
> *initp = TREE_CHAIN (old_init);
This hunk is potentially dangerous and definitely suboptimal.
Please revise this to check for
CLASS_TYPE_P (type) || TREE_CODE (type) == VECTOR_TYPE
We shouldn't be going into that code for an array type.
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
More information about the Gcc-patches
mailing list