This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: is this a string bug?
- To: kate at ahab dot rutgers dot edu (Kate Hedstrom), egcs-bugs at cygnus dot com
- Subject: Re: is this a string bug?
- From: Jason Merrill <jason at cygnus dot com>
- Date: 26 Nov 1997 01:58:13 -0800
- References: <199710282149.QAA21977.cygnus.egcs@ahab.rutgers.edu>
>>>>> Kate Hedstrom <kate@ahab.rutgers.edu> writes:
> In chapter 5 of the new Stroustrup edition there is the program
> shown below. It produces:
>> ahab% a.out
>> aa bb aa bb aa cc <return><ctrl-D>
>> cc: 6
Wed Nov 26 01:11:24 1997 Jason Merrill <jason@yorick.cygnus.com>
* typeck2.c (digest_init): Make copies where appropriate.
Index: typeck2.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/cp/typeck2.c,v
retrieving revision 1.115
diff -c -r1.115 typeck2.c
*** typeck2.c 1997/10/15 07:40:20 1.115
--- typeck2.c 1997/11/26 09:52:01
***************
*** 743,748 ****
--- 743,751 ----
init = DECL_INITIAL (init);
else if (TREE_READONLY_DECL_P (init))
init = decl_constant_value (init);
+ else if (IS_AGGR_TYPE (type) && TYPE_NEEDS_CONSTRUCTING (type))
+ init = ocp_convert (type, init, CONV_IMPLICIT|CONV_FORCE_TEMP,
+ LOOKUP_NORMAL);
return init;
}