From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40189 invoked by alias); 23 Mar 2016 12:58:49 -0000 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 Received: (qmail 40162 invoked by uid 89); 23 Mar 2016 12:58:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=preference X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 23 Mar 2016 12:58:37 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 9D9ADC00B8F1; Wed, 23 Mar 2016 12:58:35 +0000 (UTC) Received: from [10.3.113.58] (ovpn-113-58.phx2.redhat.com [10.3.113.58]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2NCwYJa028929; Wed, 23 Mar 2016 08:58:34 -0400 Subject: Re: [PATCH] Fix PR c++/70332 (ICE due to aggregate initialization of NSDMI) To: Patrick Palka References: <1458682553-20882-1-git-send-email-patrick@parcs.ath.cx> <56F1C07E.9040302@redhat.com> Cc: GCC Patches From: Jason Merrill Message-ID: <56F292FA.5010200@redhat.com> Date: Wed, 23 Mar 2016 13:05:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-03/txt/msg01316.txt.bz2 On 03/22/2016 07:12 PM, Patrick Palka wrote: > On Tue, Mar 22, 2016 at 6:12 PM, Patrick Palka wrote: >> On Tue, Mar 22, 2016 at 6:00 PM, Jason Merrill wrote: >>> On 03/22/2016 05:35 PM, Patrick Palka wrote: >>>> >>>> + if (cp_unevaluated_operand == 0 >>> >>> >>> Why check this here? >> >> Just so that the change doesn't affect the behavior of tsubst_decl() >> when cp_unevaluated_operand != 0. Presumably the existing code (10 >> lines below) handles that case just fine. > > Turns out that without the check we can trigger the cxx_dialect >= > cxx14 assert because in c++11 mode we can reach the assert through > get_defaulted_eh_spec() which increments cp_unevaluated_operand and > then calls get_nsdmi (..., /*in_ctor=*/false) causing > current_class_ref to get set to a PLACEHOLDER_EXPR. > > So for example g++.dg/cpp0x/nsdmi-template2.C regresses with an ICE. > So it seems the cp_unevaluated_operand != 0 check is necessary as long > as the assert stays. > > There are no regressions if both the cp_unevaluated_operand check and > the assert are removed however. I think that's my preference. Jason