This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for PR c++/28256 (4.1/4.2 regression) ICE on invalid code
- From: Mark Mitchell <mark at codesourcery dot com>
- To: sje at cup dot hp dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 30 Jul 2006 14:20:54 -0700
- Subject: Re: Patch for PR c++/28256 (4.1/4.2 regression) ICE on invalid code
- References: <200607281814.LAA00697@hpsje.cup.hp.com>
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