This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
PATCH for new-initializer crash
- To: Jason Merrill <jason at cygnus dot com>
- Subject: PATCH for new-initializer crash
- From: Mark Mitchell <mmitchell at usa dot net>
- Date: Mon, 16 Mar 1998 10:49:30 -0800
- Cc: egcs-bugs at cygnus dot com
- Reply-to: mmitchell at usa dot net
This change:
Wed Mar 11 07:25:20 1998 Mark Mitchell <mmitchell@usa.net>
* parse.y (new_initializer): Make sure all initializers are
lists.
broke g++.ext/arrnew.C, in the process of fixing another bug. Here's
a fix.
--
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available
Mon Mar 16 10:47:22 1998 Mark Mitchell <mmitchell@usa.net>
* parse.y: Deal with CONSTRUCTORS in new_initializers.
Index: parse.y
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/parse.y,v
retrieving revision 1.40
diff -c -p -r1.40 parse.y
*** parse.y 1998/03/11 07:25:18 1.40
--- parse.y 1998/03/16 18:45:16
*************** new_initializer:
*** 1217,1223 ****
{
if (pedantic)
pedwarn ("ANSI C++ forbids initialization of new expression with `='");
! if (TREE_CODE ($2) != TREE_LIST)
$$ = build_expr_list (NULL_TREE, $2);
else
$$ = $2;
--- 1217,1224 ----
{
if (pedantic)
pedwarn ("ANSI C++ forbids initialization of new expression with `='");
! if (TREE_CODE ($2) != TREE_LIST
! && TREE_CODE ($2) != CONSTRUCTOR)
$$ = build_expr_list (NULL_TREE, $2);
else
$$ = $2;