This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ pcc struct return fix
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: jason at redhat dot com (Jason Merrill)
- Cc: gcc-patches at gcc dot gnu dot org, mark at codesourcery dot com
- Date: Mon, 3 Dec 2001 14:53:57 -0500 (EST)
- Subject: Re: C++ pcc struct return fix
> OK, it looks like initialize_handler_parm is already using DIRECT_BIND this
> way, so it's just a documentation issue. This patch is OK for trunk and
> branch; please also adjust the comment about DIRECT_BIND in cp-tree.h to
> reflect this usage.
How does this look?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-12-03 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.
--- semantics.c.orig Wed Apr 18 13:51:48 2001
+++ semantics.c Wed Apr 18 18:16:58 2001
@@ -2240,7 +2240,8 @@
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;
}
--- cp-tree.h.save Mon Dec 3 13:26:15 2001
+++ cp-tree.h Mon Dec 3 14:01:31 2001
@@ -3309,7 +3309,9 @@
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 indicates in
+ reference initialization and in catching an exception that we don't
+ need a new constructor.
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.