public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/81952] copy elision used when constructor needs to be called
       [not found] <bug-81952-4@http.gcc.gnu.org/bugzilla/>
@ 2022-05-13 23:37 ` mpolacek at gcc dot gnu.org
  2022-05-13 23:46 ` cvs-commit at gcc dot gnu.org
  2022-05-13 23:47 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-13 23:37 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed by

commit 2170d4b6ddca526b53e87215dbf6fab5973000c7
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Mar 21 23:53:19 2018 -0400

    PR c++/81311 - wrong C++17 overload resolution.

            * call.c (build_user_type_conversion_1): Remove C++17 code.
            (conv_binds_ref_to_prvalue): New.
            (build_over_call): Handle C++17 copy elision.
            (build_special_member_call): Only do C++17 copy elision here if the
            argument is already the right type.

    From-SVN: r258755

Adjusted test:

template <class T>
struct opt {
    opt() { }
    opt(opt const& ) { __builtin_abort (); }
    opt(opt&& ) { __builtin_abort (); }

    template <class U>
    opt(U&& ) { }
};

struct foo 
{
    explicit operator opt<int>() { __builtin_abort (); return {}; }
};

int main()
{
    opt<int> o(foo{});
}

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/81952] copy elision used when constructor needs to be called
       [not found] <bug-81952-4@http.gcc.gnu.org/bugzilla/>
  2022-05-13 23:37 ` [Bug c++/81952] copy elision used when constructor needs to be called mpolacek at gcc dot gnu.org
@ 2022-05-13 23:46 ` cvs-commit at gcc dot gnu.org
  2022-05-13 23:47 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-13 23:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:62ecd2b8d46aaf96caef5fa78953216629e49ebd

commit r13-460-g62ecd2b8d46aaf96caef5fa78953216629e49ebd
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri May 13 19:45:03 2022 -0400

    c++: Add fixed test [PR81952]

    This was fixed by r258755:
    PR c++/81311 - wrong C++17 overload resolution.

            PR c++/81952

    gcc/testsuite/ChangeLog:

            * g++.dg/overload/conv-op4.C: New test.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/81952] copy elision used when constructor needs to be called
       [not found] <bug-81952-4@http.gcc.gnu.org/bugzilla/>
  2022-05-13 23:37 ` [Bug c++/81952] copy elision used when constructor needs to be called mpolacek at gcc dot gnu.org
  2022-05-13 23:46 ` cvs-commit at gcc dot gnu.org
@ 2022-05-13 23:47 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-13 23:47 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-13 23:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-81952-4@http.gcc.gnu.org/bugzilla/>
2022-05-13 23:37 ` [Bug c++/81952] copy elision used when constructor needs to be called mpolacek at gcc dot gnu.org
2022-05-13 23:46 ` cvs-commit at gcc dot gnu.org
2022-05-13 23:47 ` mpolacek at gcc dot gnu.org

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).