From patchwork Tue Jan 28 18:37:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 314807 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2252F2C0081 for ; Wed, 29 Jan 2014 05:37:15 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=fM6+Xi5wjX87Lgwr2 c6Bcq/NdKCZ4pM8wgzt6oL1pXRLVTVzbfwG11R307YSGcplU6FnGAJyZxvLECEFj avpCqQbyhMvehvkla/wPHDb0BeoSVo1NvfbCjmCFxMVDTJRDdwG7ibHgUIsd9i5b hkpgdM/aAgOcHLNLSo/XkTY5vM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=UR0tWOM/ARfZ0n+8oEiByJH cJi8=; b=mfhjhN6WnlKegnI4JK+vdO2mlcH6pWVU25GrBsrHQn3WXZg/ZP/DZPP AwkpIhXwYc4nk5yy0p3mI3ksrk/qIABW5XWGrF4sT5dCNA89FZ1z5eghFgSa878o njdxkA/0V1fA0dCDaAwMGGtM8k4po68+Mg5alFfH6OFlgiqbbtdA= Received: (qmail 10118 invoked by alias); 28 Jan 2014 18:37:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 10107 invoked by uid 89); 28 Jan 2014 18:37:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 28 Jan 2014 18:37:08 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0SIb5jn032271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Jan 2014 18:37:06 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0SIb5VY012309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Jan 2014 18:37:05 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0SIb5SB021995; Tue, 28 Jan 2014 18:37:05 GMT Received: from [192.168.1.4] (/79.47.195.178) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Jan 2014 10:37:05 -0800 Message-ID: <52E7F8CE.3010306@oracle.com> Date: Tue, 28 Jan 2014 19:37:02 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: Re: [C++ Patch] PR 51219 References: <52E67AAE.1050305@oracle.com> In-Reply-To: <52E67AAE.1050305@oracle.com> X-IsSubscribed: yes ... by the way, I don't understand why we are appending the constructor at all for the unnamed bit-field?!? Eg, what about the below? Thanks, Paolo. //////////////////// Index: cp/typeck2.c =================================================================== --- cp/typeck2.c (revision 207199) +++ cp/typeck2.c (working copy) @@ -1268,11 +1268,7 @@ process_init_constructor_record (tree type, tree i tree type; if (!DECL_NAME (field) && DECL_C_BIT_FIELD (field)) - { - flags |= picflag_from_initializer (integer_zero_node); - CONSTRUCTOR_APPEND_ELT (v, field, integer_zero_node); - continue; - } + continue; if (TREE_CODE (field) != FIELD_DECL || DECL_ARTIFICIAL (field)) continue; Index: testsuite/g++.dg/init/bitfield5.C =================================================================== --- testsuite/g++.dg/init/bitfield5.C (revision 0) +++ testsuite/g++.dg/init/bitfield5.C (working copy) @@ -0,0 +1,12 @@ +// PR c++/51219 + +struct A +{ + int i; + int : 8; +}; + +void foo() +{ + A a = { 0 }; +}