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]

C++ PATCH: Fix C99ism in init.c


This patch -- applied as obvious on the mainline -- fixes a bootstrap
problem I introduced with my previous patch.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-04-22  Mark Mitchell  <mark@codesourcery.com>

	* init.c (build_aggr_init): Fix accidental use of C99 construct in
	previous change.

Index: init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/init.c,v
retrieving revision 1.368
diff -c -5 -p -r1.368 init.c
*** init.c	22 Apr 2004 21:29:34 -0000	1.368
--- init.c	23 Apr 2004 01:05:36 -0000
*************** build_aggr_init (tree exp, tree init, in
*** 1088,1107 ****
    if (init && TREE_CODE (init) != TREE_LIST)
      flags |= LOOKUP_ONLYCONVERTING;
  
    if (TREE_CODE (type) == ARRAY_TYPE)
      {
        /* An array may not be initialized use the parenthesized
  	 initialization form -- unless the initializer is "()".  */
        if (init && TREE_CODE (init) == TREE_LIST)
  	{
  	  error ("bad array initializer");
  	  return error_mark_node;
  	}
        /* Must arrange to initialize each element of EXP
  	 from elements of INIT.  */
!       tree itype = init ? TREE_TYPE (init) : NULL_TREE;
        if (cp_type_quals (type) != TYPE_UNQUALIFIED)
  	TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type);
        if (itype && cp_type_quals (itype) != TYPE_UNQUALIFIED)
  	itype = TREE_TYPE (init) = TYPE_MAIN_VARIANT (itype);
        stmt_expr = build_vec_init (exp, NULL_TREE, init,
--- 1088,1109 ----
    if (init && TREE_CODE (init) != TREE_LIST)
      flags |= LOOKUP_ONLYCONVERTING;
  
    if (TREE_CODE (type) == ARRAY_TYPE)
      {
+       tree itype;
+ 
        /* An array may not be initialized use the parenthesized
  	 initialization form -- unless the initializer is "()".  */
        if (init && TREE_CODE (init) == TREE_LIST)
  	{
  	  error ("bad array initializer");
  	  return error_mark_node;
  	}
        /* Must arrange to initialize each element of EXP
  	 from elements of INIT.  */
!       itype = init ? TREE_TYPE (init) : NULL_TREE;
        if (cp_type_quals (type) != TYPE_UNQUALIFIED)
  	TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type);
        if (itype && cp_type_quals (itype) != TYPE_UNQUALIFIED)
  	itype = TREE_TYPE (init) = TYPE_MAIN_VARIANT (itype);
        stmt_expr = build_vec_init (exp, NULL_TREE, init,


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