This is the mail archive of the gcc-bugs@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]

C++ Bug, recent template changes


Hi,
1999-08-16  Mark Mitchell  <mark@codesourcery.com>
        * pt.c (do_pushlevel): Move to semantics.c.
        (do_poplevel): Likewise.
        (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR.
        (tsubst_expr): Don't expand all the way to RTL here.  Handle
        RETURN_INIT and CTOR_INITIALIZER.
        (instantiate_decl): Call expand_body after tsubst'ing into
        DECL_SAVED_TREE.

introduced the following
    case STMT_EXPR:
      /* This processing should really occur in tsubst_expr, However,
         tsubst_expr does not recurse into expressions, since it
         assumes that there aren't any statements inside them.
         Instead, it simply calls build_expr_from_tree.  So, we need
         to expand the STMT_EXPR here.  */
      if (!processing_template_decl)
        {
          tree rtl_expr = begin_stmt_expr ();
          tree block = tsubst_expr (STMT_EXPR_STMT (t), args,
                                    complain, in_decl);
          r = finish_stmt_expr (rtl_expr, block);
        }
      return r;
which evokes an 'r used uninitialized' warning.

r _does_ appear to be uninitialized at the return point.

nathan
-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
        I have seen the death of PhotoShop -- it is called GIMP
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk


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