From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37405 invoked by alias); 20 Dec 2018 16:09:26 -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 36365 invoked by uid 89); 20 Dec 2018 16:09:24 -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=H*M:54bb, sk:manifes X-HELO: mail-qt1-f172.google.com Received: from mail-qt1-f172.google.com (HELO mail-qt1-f172.google.com) (209.85.160.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Dec 2018 16:09:22 +0000 Received: by mail-qt1-f172.google.com with SMTP id y20so2335950qtm.13 for ; Thu, 20 Dec 2018 08:09:22 -0800 (PST) Return-Path: Received: from [192.168.1.149] (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 q70sm5391572qkq.10.2018.12.20.08.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 08:09:19 -0800 (PST) Subject: Re: [C++ Patch] [PR c++/88146] do not crash synthesizing inherited ctor(...) To: Alexandre Oliva , Christophe Lyon Cc: gcc-patches List References: <81ac6c22-8907-a166-b8df-80e06d2850da@redhat.com> <12883fc9-4e44-e16d-fdc6-9a90c21bf01c@redhat.com> From: Jason Merrill Message-ID: Date: Thu, 20 Dec 2018 16:18: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/msg01475.txt.bz2 On 12/19/18 7:04 PM, Alexandre Oliva wrote: > Christophe, > > Thanks again for the report. This was quite an adventure to figure > out ;-) See below. > > > [PR88146] avoid diagnostics diffs if cdtor_returns_this > > Diagnostics for testsuite/g++.dg/cpp0x/inh-ctor32.C varied across > platforms. Specifically, on ARM, the diagnostics within the subtest > derived_ctor::inherited_derived_ctor::constexpr_noninherited_ctor did > not match those displayed on other platforms, and the test failed. > > The difference seemed to have to do with locations assigned to ctors, > but it was more subtle: on ARM, the instantiation of bor's template > ctor was nested within the instantiation of bar's template ctor > inherited from bor. The reason turned out to be related with the > internal return type of ctors: arm_cxx_cdtor_returns_this is enabled > for because of AAPCS, while cxx.cdtor_returns_this is disabled on most > other platforms. While convert_to_void returns early with a VOID > expr, the non-VOID return type of the base ctor CALL_EXPR causes > convert_to_void to inspect the called decl for nodiscard attributes: > maybe_warn_nodiscard -> cp_get_fndecl_from_callee -> > maybe_constant_init -> cxx_eval_outermost_constant_expr -> > instantiate_constexpr_fns -> nested instantiation. I think the bug is in calling instantiate_constexpr_fns in this case. I think that should only happen when ctx->manifestly_const_eval. Jason