From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2307 invoked by alias); 3 Dec 2001 19:54:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 2238 invoked from network); 3 Dec 2001 19:53:59 -0000 Received: from unknown (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sources.redhat.com with SMTP; 3 Dec 2001 19:53:59 -0000 Received: from hiauly1.hia.nrc.ca (localhost [127.0.0.1]) by hiauly1.hia.nrc.ca (8.12.0.Beta16/8.12.0.Beta16) with ESMTP id fB3Jrv7c028731; Mon, 3 Dec 2001 14:53:58 -0500 (EST) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.0.Beta16/8.12.0.Beta16) id fB3Jrv4r028730; Mon, 3 Dec 2001 14:53:57 -0500 (EST) Message-Id: <200112031953.fB3Jrv4r028730@hiauly1.hia.nrc.ca> Subject: Re: C++ pcc struct return fix To: jason@redhat.com (Jason Merrill) Date: Mon, 03 Dec 2001 11:54:00 -0000 From: "John David Anglin" Cc: gcc-patches@gcc.gnu.org, mark@codesourcery.com In-Reply-To: from "Jason Merrill" at Dec 3, 2001 06:38:51 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2001-12/txt/msg00209.txt.bz2 > 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 * 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.