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++/91212] [8/9/10/11 Regression] const ignored for ctor arguments within return since r8-2493-g4ce8c5dea53d8073
Date: Wed, 29 Jul 2020 18:25:23 +0000	[thread overview]
Message-ID: <bug-91212-4-1eHLrk1ZSQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-91212-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 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:81bc0ec3e926d7a2c90502847ddaacf3d56d5b75

commit r11-2411-g81bc0ec3e926d7a2c90502847ddaacf3d56d5b75
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jul 29 00:57:40 2020 -0400

    c++: Avoid calling const copy ctor on implicit move. [PR91212]

    Our implementation of C++11 implicit move was wrong for return; we didn't
    actually hit the check for the type of the first parameter of the selected
    constructor, because we didn't see LOOKUP_PREFER_RVALUE set properly.

    Fixing that to look at the right flags fixed the issue for this testcase,
    but broke implicit move for a by-value converting constructor (PR58051).  I
    think this was not allowed in C++17, but it is allowed under the implicit
    move changes from C++20, and those changes were voted to apply as a DR to
    earlier standards as well, so I don't want to break it now.

    So after fixing the flags check I changed the test to allow value
    parameters.

    gcc/cp/ChangeLog:

            PR c++/91212
            * call.c (build_over_call): Don't call a const ref
            overload for implicit move.

    gcc/testsuite/ChangeLog:

            PR c++/91212
            * g++.dg/cpp0x/move-return3.C: New test.

       reply	other threads:[~2020-07-29 18:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-91212-4@http.gcc.gnu.org/bugzilla/>
2020-07-29 18:25 ` cvs-commit at gcc dot gnu.org [this message]
2020-09-27 23:37 ` blubban at gmail dot com
2021-05-14  9:51 ` [Bug c++/91212] [9/10 " jakub at gcc dot gnu.org
2021-06-01  8:14 ` rguenth at gcc dot gnu.org
2022-05-27  9:41 ` [Bug c++/91212] [10 " rguenth at gcc dot gnu.org
2022-06-28 10:38 ` jakub at gcc dot gnu.org
2023-03-07 17:43 ` mpolacek 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-91212-4-1eHLrk1ZSQ@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).