From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25067 invoked by alias); 15 Jun 2004 00:56:13 -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 25004 invoked from network); 15 Jun 2004 00:56:12 -0000 Received: from unknown (HELO mailrelay.t-mobile.com) (208.54.142.1) by sourceware.org with SMTP; 15 Jun 2004 00:56:12 -0000 Received: from codesourcery.com (unknown [10.253.176.51]) by mailrelay.t-mobile.com (Postfix) with ESMTP id 46D78189D4; Mon, 14 Jun 2004 17:40:30 -0700 (PDT) Message-ID: <40CE4933.2060509@codesourcery.com> Date: Tue, 15 Jun 2004 03:04:00 -0000 From: Mark Mitchell Organization: CodeSourcery, LLC User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 MIME-Version: 1.0 To: Giovanni Bajo Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [C++ PATCH] [PR2204] Check for parameters of abstract types - Take 3 References: <1c9c01c3ef6c$71c10f10$9cba2997@bagio><1d8201c3ef7f$41471b50$9cba2997@bagio><1f3901c3effc$90c19a70$9cba2997@bagio><26e001c44faa$9ab6ea90$444e2a97@bagio><40CC0ABC.3050009@codesourcery.com> <2f1101c4526c$6e1015b0$444e2a97@bagio> <40CE3E32.9040102@codesourcery.com> <2f7701c45271$5d69bf90$444e2a97@bagio> In-Reply-To: <2f7701c45271$5d69bf90$444e2a97@bagio> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg01081.txt.bz2 Giovanni Bajo wrote: > Exactly. If you look in the testcase of my patch, it checks for some slightly > different situations which require delayed evaluation of abstract types. The > testcase was carefully constructed thinking of different situations. > >>Presumably, we would already diagnose it if someone tried to call or >>define "f"? > > > Yes, we do that at the definition point. Calling f() is impossible: if use *s > with a S*, we get an error because we cannot allocate the temporary. Yes, that's what I meant. Curiously, EDG diagnoses the example I gave, but not: struct S; extern S s; struct S { virtual void g() = 0; }; Anyhow, why not just keep a list of all VAR_DECLs and FUNCTION_DECLs that have a parameter of an incomplete type, attached to that incomplete type? Then, when a type is completed, if it is abstract, run down the list issuing error messages. After the type is complete, clear the list. To save space, use a hash table mapping class types to these lists, rather than using space in every class type. -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com