aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-tree.h5
-rw-r--r--gcc/cp/semantics.c3
3 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8329fb3..26841bb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 420e2d9..992c708 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 75cfa69..776f06f 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -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;
}