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 for c++/16112


My recent patch for 16015 wrapped the return value of a
statement-expression in a CLEANUP_POINT_EXPR, which confused
cp_gimplify_init_expr.  Fixed thus.

Tested x86_64-pc-linux-gnu, applied to trunk.  Test in
g++.dg/ext/stmtexpr3.C.

2004-06-21  Jason Merrill  <jason@redhat.com>

	PR c++/16112
	* cp-gimplify.c (cp_gimplify_init_expr): Look through
	CLEANUP_POINT_EXPR.

*** cp-gimplify.c.~1~	2004-06-22 16:21:49.000000000 -0400
--- cp-gimplify.c	2004-06-22 16:21:13.000000000 -0400
*************** cp_gimplify_init_expr (tree *expr_p, tre
*** 116,121 ****
--- 116,123 ----
       case, I guess we'll need to replace references somehow.  */
    if (TREE_CODE (from) == TARGET_EXPR)
      from = TARGET_EXPR_INITIAL (from);
+   if (TREE_CODE (from) == CLEANUP_POINT_EXPR)
+     from = TREE_OPERAND (from, 0);
  
    /* Look through any COMPOUND_EXPRs.  */
    sub = expr_last (from);

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