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]

Re: Patch for PR c++/28256 (4.1/4.2 regression) ICE on invalid code


Steve Ellcey wrote:

> 2006-07-28  Steve Ellcey  <sje@cup.hp.com>
> 
> 	PR c++/28256
> 	* decl.c (check_initializer): Check for 1 initializer on scalar types.
> 
> Index: decl.c
> ===================================================================
> --- decl.c	(revision 115787)
> +++ decl.c	(working copy)
> @@ -4730,6 +4730,15 @@ check_initializer (tree decl, tree init,
>        TREE_TYPE (decl) = error_mark_node;
>        init = NULL_TREE;
>      }
> +  else if (!CP_AGGREGATE_TYPE_P (type)
> +	   && init && TREE_CODE (init) == CONSTRUCTOR
> +	   && BRACE_ENCLOSED_INITIALIZER_P (init)

The last two conditions are redundant; BRACE_ENCLOSED_INITIALIZER_P
implies TREE_CODE == CONSTRUCTOR.  Please remove the CONSTRUCTOR check.

OK with that change.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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