From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22443 invoked by alias); 14 Jan 2019 21:40:58 -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 22433 invoked by uid 89); 14 Jan 2019 21:40:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy= X-HELO: mail-qt1-f177.google.com Received: from mail-qt1-f177.google.com (HELO mail-qt1-f177.google.com) (209.85.160.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jan 2019 21:40:56 +0000 Received: by mail-qt1-f177.google.com with SMTP id r14so790138qtp.1 for ; Mon, 14 Jan 2019 13:40:56 -0800 (PST) Return-Path: Received: from [192.168.1.115] (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 v50sm47848560qtc.7.2019.01.14.13.40.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 13:40:53 -0800 (PST) Subject: Re: C++ PATCH for c++/88825 - ICE with bogus function return type deduction To: Marek Polacek Cc: GCC Patches References: <20190114021134.GC19569@redhat.com> <145de396-ba95-0df9-8b42-5847183d77d1@redhat.com> <20190114201531.GF19569@redhat.com> From: Jason Merrill Message-ID: <88447a22-3cec-b5e5-0a5f-c5c644667843@redhat.com> Date: Mon, 14 Jan 2019 21:40: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: <20190114201531.GF19569@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00805.txt.bz2 On 1/14/19 3:15 PM, Marek Polacek wrote: > On Mon, Jan 14, 2019 at 03:06:33PM -0500, Jason Merrill wrote: >> On 1/13/19 9:11 PM, Marek Polacek wrote: >>> In this (invalid) testcase the return type deduction failed so FUNCTYPE was >>> error_mark_node and can_do_nrvo_p crashed. One way to fix this would be to >>> check error_operand_p as below. >>> >>> Bootstrapped/regtested on x86_64-linux, ok for trunk? >>> >>> 2019-01-13 Marek Polacek >>> >>> PR c++/88825 - ICE with bogus function return type deduction. >>> * typeck.c (can_do_nrvo_p): Check error_operand_p. >> >> error_operand_p also checks TREE_TYPE of its operand, is that useful here >> instead of only comparing functype to error_mark_node? > > Actually, it isn't. So we can get away with a simple comparison, as in the > below: > > Bootstrapped/regtested on x86_64-linux, ok for trunk? OK. Jason