From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25684 invoked by alias); 7 Dec 2012 13:43:14 -0000 Received: (qmail 25672 invoked by uid 22791); 7 Dec 2012 13:43:12 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ee0-f47.google.com (HELO mail-ee0-f47.google.com) (74.125.83.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Dec 2012 13:43:09 +0000 Received: by mail-ee0-f47.google.com with SMTP id e51so282673eek.20 for ; Fri, 07 Dec 2012 05:43:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.225.194 with SMTP id z42mr17048285eep.22.1354887787878; Fri, 07 Dec 2012 05:43:07 -0800 (PST) Received: by 10.14.141.134 with HTTP; Fri, 7 Dec 2012 05:43:07 -0800 (PST) In-Reply-To: <20121207133901.GW2315@tucnak.redhat.com> References: <50C1790B.3040704@redhat.com> <50C1B327.9060006@ubuntu.com> <20121207133901.GW2315@tucnak.redhat.com> Date: Fri, 07 Dec 2012 13:43:00 -0000 Message-ID: Subject: Re: C++ PATCH for c++/54325 (wrong error initializing abstract base class) From: Gabriel Dos Reis To: Jakub Jelinek Cc: Matthias Klose , Jason Merrill , gcc-patches List Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-12/txt/msg00490.txt.bz2 On Fri, Dec 7, 2012 at 7:39 AM, Jakub Jelinek wrote: > On Fri, Dec 07, 2012 at 07:34:30AM -0600, Gabriel Dos Reis wrote: >> On Fri, Dec 7, 2012 at 3:13 AM, Matthias Klose wrote: >> > Am 07.12.2012 06:05, schrieb Jason Merrill: >> >> It's perfectly OK to initialize a base class of abstract type; it's only an >> >> error to create a full object of such a type. So this patch moves the check >> >> from more generic initialization code out into a function that's definitely >> >> creating a new object. >> >> >> >> Tested x86_64-pc-linux-gnu, applying to trunk and 4.7. >> > >> > this doesn't build on the branch: >> > >> > ../gcc/cp/tree.c: In function 'build_aggr_init_expr': >> > ../gcc/cp/tree.c:399:1: error: parameter name omitted >> > >> > this fixes the bootstrap, currently running the testsuite. >> > >> > --- cp/tree.c~ 2012-12-07 10:01:16.665415647 +0100 >> > +++ cp/tree.c 2012-12-07 10:11:01.373410862 +0100 >> > @@ -396,7 +396,8 @@ >> > callable. */ >> > >> > tree >> > -build_aggr_init_expr (tree type, tree init, tsubst_flags_t /*complain*/) >> > +build_aggr_init_expr (tree type, tree init, >> > + tsubst_flags_t complain ATTRIBUTE_UNUSED) >> > { >> > tree fn; >> > tree slot; >> > >> >> We should definitely teach the compiler to accept the former and not >> be silly in requiring the latter when C++. > > Except that GCC 4.7 doesn't mandate building with C++, so the sources must > be valid C. > > Jakub Right you are! Thanks, -- Gaby