From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9828 invoked by alias); 7 Dec 2012 13:34:40 -0000 Received: (qmail 9781 invoked by uid 22791); 7 Dec 2012 13:34:39 -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:34:32 +0000 Received: by mail-ee0-f47.google.com with SMTP id e51so277874eek.20 for ; Fri, 07 Dec 2012 05:34:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.219.3 with SMTP id l3mr16990548eep.5.1354887270093; Fri, 07 Dec 2012 05:34:30 -0800 (PST) Received: by 10.14.141.134 with HTTP; Fri, 7 Dec 2012 05:34:30 -0800 (PST) In-Reply-To: <50C1B327.9060006@ubuntu.com> References: <50C1790B.3040704@redhat.com> <50C1B327.9060006@ubuntu.com> Date: Fri, 07 Dec 2012 13:34:00 -0000 Message-ID: Subject: Re: C++ PATCH for c++/54325 (wrong error initializing abstract base class) From: Gabriel Dos Reis To: Matthias Klose Cc: 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/msg00487.txt.bz2 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++. -- Gaby