semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in call to build_aggr_...
authorJohn David Anglin <dave@hiauly1.hia.nrc.ca>
Sat, 8 Dec 2001 15:44:23 +0000 (15:44 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sat, 8 Dec 2001 15:44:23 +0000 (15:44 +0000)
* semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in
call to build_aggr_init.
* cp-tree.h (DIRECT_BIND): Document new use of DIRECT_BIND.

From-SVN: r47793

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/semantics.c

index 8329fb3..26841bb 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-08  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
+       * semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in
+       call to build_aggr_init.
+       * cp-tree.h (DIRECT_BIND): Document new use of DIRECT_BIND.
+
 2001-12-08  Neil Booth  <neil@daikokuya.demon.co.uk>
 
        * parse.y: Replace uses of the string non-terminal with STRING.
index 420e2d9..992c708 100644 (file)
@@ -3312,7 +3312,10 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
    LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
    DIRECT_BIND means that if a temporary is created, it should be created so
      that it lives as long as the current variable bindings; otherwise it
-     only lives until the end of the complete-expression.
+     only lives until the end of the complete-expression.  It also forces
+     direct-initialization in cases where other parts of the compiler have
+     already generated a temporary, such as reference initialization and the
+     catch parameter.
    LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
      after.  Note, LOOKUP_COMPLAIN is checked and error messages printed
      before LOOKUP_SPECULATIVELY is checked.
index 75cfa69..776f06f 100644 (file)
@@ -2320,7 +2320,8 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
       int old_ac = flag_access_control;
 
       flag_access_control = 0;
-      call_expr = build_aggr_init (slot, call_expr, LOOKUP_ONLYCONVERTING);
+      call_expr = build_aggr_init (slot, call_expr,
+                                  DIRECT_BIND | LOOKUP_ONLYCONVERTING);
       flag_access_control = old_ac;
       copy_from_buffer_p = 1;
     }