From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127155 invoked by alias); 2 Dec 2018 04:26:04 -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 127084 invoked by uid 89); 2 Dec 2018 04:25:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Patch, Hx-languages-length:825, grokdeclarator X-HELO: mail-qt1-f170.google.com Received: from mail-qt1-f170.google.com (HELO mail-qt1-f170.google.com) (209.85.160.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Dec 2018 04:25:55 +0000 Received: by mail-qt1-f170.google.com with SMTP id n32so10317894qte.11 for ; Sat, 01 Dec 2018 20:25:55 -0800 (PST) Return-Path: Received: from [192.168.1.132] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id x49sm6986388qta.89.2018.12.01.20.25.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Dec 2018 20:25:52 -0800 (PST) Subject: Re: [C++ Patch] PR 84636 ("internal compiler error: Segmentation fault (identifier_p()/grokdeclarator())") To: Paolo Carlini , Marek Polacek Cc: "gcc-patches@gcc.gnu.org" References: <7e0b3ae8-3c74-f2a3-29f3-351b1d105a4b@oracle.com> <20181119222438.GZ28582@redhat.com> <7fd44f6c-ea51-49a4-8f68-0e18fa2dc215@oracle.com> From: Jason Merrill Message-ID: <01ea89b1-c00d-b49c-90f8-11db65587875@redhat.com> Date: Sun, 02 Dec 2018 04:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00028.txt.bz2 On 11/21/18 7:03 PM, Paolo Carlini wrote: > ... in fact I'm thinking that the below - which directly checks for > unqualified_id to be non-null in both places - may be a better variant: > among other things it means that for related testcases like: > typedef void a(); > struct A > { a a1: 1; }; > we get the location of a1 right (we could also change the diagnostics in > grokbitfield to use DECL_SOURCE_LOCATION and exploit it), and the > testsuite doesn't need adjustments. Tested x86_64-linux. > - else if (TREE_CODE (type) == FUNCTION_TYPE > - || TREE_CODE (type) == METHOD_TYPE) > + else if (FUNC_OR_METHOD_TYPE_P (type) && unqualified_id) Maybe change this to else if (funcdecl_p) ? OK either way. Jason