From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38778 invoked by alias); 14 Jun 2018 19:40:59 -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 38764 invoked by uid 89); 14 Jun 2018 19:40:58 -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,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Jun 2018 19:40:56 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C42B0859BF for ; Thu, 14 Jun 2018 19:40:54 +0000 (UTC) Received: from redhat.com (ovpn-125-213.rdu2.redhat.com [10.10.125.213]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A606210C6D1; Thu, 14 Jun 2018 19:40:54 +0000 (UTC) Date: Thu, 14 Jun 2018 19:40:00 -0000 From: Marek Polacek To: Jason Merrill Cc: GCC Patches Subject: Re: C++ PATCH for c++/86063, ICE with attribute with pack expansion Message-ID: <20180614194052.GH17989@redhat.com> References: <20180606211835.GC28085@redhat.com> <20180614165107.GG17989@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-SW-Source: 2018-06/txt/msg00879.txt.bz2 On Thu, Jun 14, 2018 at 12:59:00PM -0400, Jason Merrill wrote: > On Thu, Jun 14, 2018 at 12:51 PM, Marek Polacek wrote: > > On Mon, Jun 11, 2018 at 03:00:04PM -0400, Jason Merrill wrote: > >> On Wed, Jun 6, 2018 at 5:18 PM, Marek Polacek wrote: > >> > We crash on this testcase containing a bogus attribute, because > >> > cp_check_const_attributes accessed TREE_VALUE of a tree that happened to be > >> > expr_pack_expansion. Since here we're merely trying to evaluate constexpr > >> > arguments, I thought we could skip such bogus arguments. > >> > >> Hmm, attributes should always be a TREE_LIST, lots of places assume > >> that. Why isn't the pack expansion wrapped in a TREE_LIST? > > > > I believe you did that on purpose. There pack comes from > > cp_parser_std_attribute_list. We could wrap it into a TREE_LIST, but then > > tsubst_attribute would have to be tweaked to handle the pack expansion > > correctly. > > How so? tsubst_attribute expects to find a pack expansion in the > TREE_VALUE of a TREE_LIST. > And cp_parser_std_attribute_list puts the pack expansion in TREE_VALUE. Exactly. But what tsubst_attribute gets currently is > value >> value readonly tree_0 arg:0 alignas4.C:17:19 start: alignas4.C:17:19 finish: alignas4.C:17:29>> arg:1 >>> so if I were to wrap the expr_pack_expansion in a TREE_LIST, I would have to adjust tsubst_attribute. But cp_check_const_attributes doesn't expect that the TREE_VALUE of the above is a non-list. Right? Marek