public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Alexandre Oliva <aoliva@redhat.com>,
	Christophe Lyon <christophe.lyon@linaro.org>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ Patch] [PR c++/88146] do not crash synthesizing inherited ctor(...)
Date: Thu, 20 Dec 2018 16:18:00 -0000	[thread overview]
Message-ID: <d08703a7-71b7-6d06-54bb-d84c3dad7a64@redhat.com> (raw)
In-Reply-To: <or4lb983no.fsf@lxoliva.fsfla.org>

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

  parent reply	other threads:[~2018-12-20 16:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-07  0:23 Alexandre Oliva
2018-12-14 20:14 ` Alexandre Oliva
2018-12-14 20:42 ` Jason Merrill
2018-12-14 21:41   ` Jason Merrill
2018-12-14 22:34     ` Alexandre Oliva
2018-12-14 22:44       ` Jason Merrill
2018-12-14 23:05         ` Alexandre Oliva
2018-12-15 22:11           ` Jason Merrill
2018-12-19 14:36             ` Christophe Lyon
2018-12-19 18:49               ` Alexandre Oliva
2018-12-19 18:52                 ` Jakub Jelinek
2018-12-20  0:04               ` Alexandre Oliva
2018-12-20 16:00                 ` Christophe Lyon
2018-12-20 16:18                 ` Jason Merrill [this message]
2018-12-28 22:53                   ` Alexandre Oliva
2018-12-29  6:40                     ` Alexandre Oliva
2018-12-29 13:33                       ` Jakub Jelinek
2019-01-04 18:55                       ` Jason Merrill
2019-01-17  4:12                         ` Alexandre Oliva
2018-12-29 10:28                     ` Alexandre Oliva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d08703a7-71b7-6d06-54bb-d84c3dad7a64@redhat.com \
    --to=jason@redhat.com \
    --cc=aoliva@redhat.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).