From patchwork Fri Jan 17 11:38:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 312040 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 C0D1B2C0078 for ; Fri, 17 Jan 2014 22:39:05 +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:content-type; q=dns; s=default; b=A3UcenQOkV+VTvURp22v5Rbj5UHj6Hc6zey+HPWPg3B qlAFerPGNBDsK5pe+X2RaqD4n7ZuL+1mYFLHuRrlTL4v2T8JvLQU/5ZPaLEMB6yn PalgUVGhd4KDN2LWw0+t4SN8QkDFX46k+FOQdrh891p89UH6C7TFo8KKR/i2B4UI = 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:content-type; s=default; bh=+vkBIDrVwpE48teUNp9ptTjEHxg=; b=oi+UUObt4XzPBxvRD 59l1POQT3eixKCVwJWhHqK9MESn81vj5mQN3lH3dO6MBaMWUaPufcq71sJNSlk6l rGq/AFleefK8CbeqXEBO+2oUi3Hc0CPhqcC07+nPWz/RwhXn9+FI3OR1Fe8ADa+Y /eUSWv4sVY/Dd4KAtOLQyxD0rM= Received: (qmail 28882 invoked by alias); 17 Jan 2014 11:38:59 -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 28866 invoked by uid 89); 17 Jan 2014 11:38:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, FSL_NEW_HELO_USER, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 17 Jan 2014 11:38:58 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0HBctYd031173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Jan 2014 11:38:56 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0HBcsQD020560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 17 Jan 2014 11:38:55 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0HBcsZ7020553; Fri, 17 Jan 2014 11:38:54 GMT Received: from [192.168.1.4] (/79.43.214.73) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 Jan 2014 03:38:54 -0800 Message-ID: <52D9164B.9000106@oracle.com> Date: Fri, 17 Jan 2014 12:38:51 +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: [C++ Patch] PR 59269 X-IsSubscribed: yes Hi, I think we can handle this 4.9 Regression ICE in build_value_init_noctor the same way as cx_check_missing_mem_inits: only enforce !TYPE_HAS_COMPLEX_DFLT when errorcount == 0 (I also double checked that in the case at issue type_has_constexpr_default_constructor is true). Tested x86_64-linux. Thanks, Paolo. //////////////////// /cp 2014-01-17 Paolo Carlini PR c++/59269 * init.c (build_value_init_noctor): Assert !TYPE_HAS_COMPLEX_DFLT only when errorcount == 0. /testsuite 2014-01-17 Paolo Carlini PR c++/59269 * g++.dg/cpp0x/nsdmi-union4.C: New. Index: cp/init.c =================================================================== --- cp/init.c (revision 206700) +++ cp/init.c (working copy) @@ -382,7 +382,8 @@ build_value_init_noctor (tree type, tsubst_flags_t SFINAE-enabled. */ if (CLASS_TYPE_P (type)) { - gcc_assert (!TYPE_HAS_COMPLEX_DFLT (type)); + gcc_assert (!TYPE_HAS_COMPLEX_DFLT (type) + || errorcount != 0); if (TREE_CODE (type) != UNION_TYPE) { Index: testsuite/g++.dg/cpp0x/nsdmi-union4.C =================================================================== --- testsuite/g++.dg/cpp0x/nsdmi-union4.C (revision 0) +++ testsuite/g++.dg/cpp0x/nsdmi-union4.C (working copy) @@ -0,0 +1,12 @@ +// PR c++/59269 +// { dg-require-effective-target c++11 } + +union U +{ + int& i = 0; // { dg-error "reference" } +}; + +void foo() +{ + U(); +}