From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH for c++/57728 (explicit instantiation and defaulted functions)
Date: Tue, 30 Aug 2016 11:38:00 -0000 [thread overview]
Message-ID: <ydd60qixz90.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <CADzB+2n8ybU7ApT_s1ZaJuOMB3rBPDN-brt_bvZ2kDu-Tj4XkA@mail.gmail.com> (Jason Merrill's message of "Fri, 26 Aug 2016 11:09:54 -0400")
Hi Jason,
> The testcase in 57728 demonstrates that we have been treating
> functions explicitly defaulted in the class body inconsistently with
> explicit instantiation: an extern instantiation causes them not to be
> generated, but a normal explicit instantiation doesn't cause them to
> be emitted, leading to link errors.
>
> After discussing this issue with other vendors (who had the same bug),
> we have decided to treat these functions like implicitly declared
> members, so explicit instantiation consistently doesn't affect them.
>
> The second patch addresses a FIXME I noticed while looking at this:
> there's no reason for us to be calling a trivial default constructor
> in the first place.
>
> Tested x86_64-pc-linux-gnu, applying to trunk.
[...]
> diff --git a/gcc/testsuite/g++.dg/cpp0x/explicit12.C b/gcc/testsuite/g++.dg/cpp0x/explicit12.C
> new file mode 100644
> index 0000000..5c14c01
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/cpp0x/explicit12.C
> @@ -0,0 +1,17 @@
> +// PR c++/57728
> +// { dg-do link { target c++11 } }
[...]
> diff --git a/gcc/testsuite/g++.dg/cpp0x/explicit12.C b/gcc/testsuite/g++.dg/cpp0x/explicit12.C
> index 5c14c01..912d507 100644
> --- a/gcc/testsuite/g++.dg/cpp0x/explicit12.C
> +++ b/gcc/testsuite/g++.dg/cpp0x/explicit12.C
> @@ -15,3 +15,5 @@ int main()
> {
> A<int> a;
> }
> +
> +// { dg-final { scan-assembler-not "_ZN1AIiEC1Ev" } }
>
This test currently shows up as UNRESOLVED, and g++.log has
g++.dg/cpp0x/explicit12.C -std=c++11 : output file does not exist
Was this meant as a compile instead of link test, like the companion
explicit11.C?
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
prev parent reply other threads:[~2016-08-30 11:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-26 15:10 Jason Merrill
2016-08-30 11:38 ` Rainer Orth [this message]
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=ydd60qixz90.fsf@CeBiTec.Uni-Bielefeld.DE \
--to=ro@cebitec.uni-bielefeld.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/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).