public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/98642] [10/11 Regression] wrong "use of deleted function" error
Date: Fri, 15 Jan 2021 18:57:19 +0000	[thread overview]
Message-ID: <bug-98642-4-ikq442dIWL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98642-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98642

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:d75199f782348bfc401f925b60f33ffc9822b7cc

commit r11-6736-gd75199f782348bfc401f925b60f33ffc9822b7cc
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jan 13 13:27:06 2021 -0500

    c++: Avoid redundant copy in {} init [PR98642]

    Here, initializing from { } implies a call to the default constructor for
    base.  We were then seeing that we're initializing a base subobject, so we
    tried to copy the result of that call.  This is clearly wrong; we should
    initialize the base directly from its default constructor.

    This patch does a lot of refactoring of unsafe_copy_elision_p and adds
    make_safe_copy_elision that will also try to do the base constructor
    rewriting from the last patch.

    gcc/cp/ChangeLog:

            PR c++/98642
            * call.c (unsafe_return_slot_p): Return int.
            (init_by_return_slot_p): Split out from...
            (unsafe_copy_elision_p): ...here.
            (unsafe_copy_elision_p_opt): New name for old meaning.
            (build_over_call): Adjust.
            (make_safe_copy_elision): New.
            * typeck2.c (split_nonconstant_init_1): Elide copy from safe
            list-initialization.
            * cp-tree.h: Adjust.

    gcc/testsuite/ChangeLog:

            PR c++/98642
            * g++.dg/cpp1z/elide5.C: New test.

  parent reply	other threads:[~2021-01-15 18:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 19:51 [Bug c++/98642] New: " mpolacek at gcc dot gnu.org
2021-01-12 19:52 ` [Bug c++/98642] [10/11 Regression] " mpolacek at gcc dot gnu.org
2021-01-12 19:56 ` mpolacek at gcc dot gnu.org
2021-01-12 20:55 ` jason at gcc dot gnu.org
2021-01-15 18:57 ` cvs-commit at gcc dot gnu.org [this message]
2021-01-15 19:12 ` jason at gcc dot gnu.org
2021-01-27  9:34 ` [Bug c++/98642] [10 " rguenth at gcc dot gnu.org
2021-01-27  9:36 ` rguenth at gcc dot gnu.org
2021-01-29 16:00 ` cvs-commit at gcc dot gnu.org
2021-03-19 13:21 ` jakub at gcc dot gnu.org
2021-03-29 11:19 ` rguenth at gcc dot gnu.org

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=bug-98642-4-ikq442dIWL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).