[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2023-07-11 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

Jonathan Wakely  changed:

   What|Removed |Added

 CC||duyang.seu at gmail dot com

--- Comment #19 from Jonathan Wakely  ---
*** Bug 89793 has been marked as a duplicate of this bug. ***

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2023-06-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

--- Comment #18 from CVS Commits  ---
The trunk branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:4ec6b627cb008e31ea3d1ee93a209297f56c6a3e

commit r14-1810-g4ec6b627cb008e31ea3d1ee93a209297f56c6a3e
Author: Jason Merrill 
Date:   Fri Mar 3 15:04:25 2023 -0500

c++: tweak c++17 ctor/conversion tiebreaker [DR2327]

In discussion of this issue CWG decided that the change of behavior on
well-formed code like overload-conv-4.C is undesirable.  In further
discussion of possible resolutions, we discovered that we can avoid that
change while still getting the desired behavior on overload-conv-3.C by
making this a tiebreaker after comparing conversions, rather than before.
This also simplifies the implementation.

The issue resolution has not yet been finalized, but this seems like a
clear
improvement.

DR 2327
PR c++/86521

gcc/cp/ChangeLog:

* call.cc (joust_maybe_elide_copy): Don't change cand.
(joust): Move the elided tiebreaker later.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/overload-conv-4.C: Remove warnings.
* g++.dg/cpp1z/elide7.C: New test.

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2020-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #17 from Jason Merrill  ---
Fixed for 8.4+.

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2020-02-25 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

--- Comment #15 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jason Merrill
:

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

commit r8-10078-gf93784da474823ad563a9dfd6fd535a017b4bc9f
Author: Jason Merrill 
Date:   Wed Feb 26 00:33:52 2020 -0500

PR c++/86521 - wrong overload resolution with ref-qualifiers.

Here we were wrongly treating binding a const lvalue ref to an xvalue as
direct binding, which is wrong under [dcl.init.ref] and [over.match.ref].

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  

PR c++/86521 - wrong overload resolution with ref-qualifiers.
* call.c (build_user_type_conversion_1): Don't use a conversion to a
reference of the wrong rvalueness for direct binding.

--- Comment #16 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:32988aac5be4fa472823e21d2d0eb877faca5667

commit r8-10080-g32988aac5be4fa472823e21d2d0eb877faca5667
Author: Jason Merrill 
Date:   Wed Feb 26 00:33:52 2020 -0500

PR c++/86521 - C++17 copy elision in initialization by constructor.

This is an overlooked case in C++17 mandatory copy elision: We want
overload
resolution to reflect that initializing an object from a prvalue does not
involve a copy or move constructor even when [over.match.ctor] says that
only constructors are candidates.  Here I implement that by looking through
the copy/move constructor in joust.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  

PR c++/86521 - C++17 copy elision in initialization by constructor.
* call.c (joust_maybe_elide_copy): New.
(joust): Call it.

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2020-02-25 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

--- Comment #16 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:32988aac5be4fa472823e21d2d0eb877faca5667

commit r8-10080-g32988aac5be4fa472823e21d2d0eb877faca5667
Author: Jason Merrill 
Date:   Wed Feb 26 00:33:52 2020 -0500

PR c++/86521 - C++17 copy elision in initialization by constructor.

This is an overlooked case in C++17 mandatory copy elision: We want
overload
resolution to reflect that initializing an object from a prvalue does not
involve a copy or move constructor even when [over.match.ctor] says that
only constructors are candidates.  Here I implement that by looking through
the copy/move constructor in joust.

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  

PR c++/86521 - C++17 copy elision in initialization by constructor.
* call.c (joust_maybe_elide_copy): New.
(joust): Call it.

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2020-02-25 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

--- Comment #15 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jason Merrill
:

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

commit r8-10078-gf93784da474823ad563a9dfd6fd535a017b4bc9f
Author: Jason Merrill 
Date:   Wed Feb 26 00:33:52 2020 -0500

PR c++/86521 - wrong overload resolution with ref-qualifiers.

Here we were wrongly treating binding a const lvalue ref to an xvalue as
direct binding, which is wrong under [dcl.init.ref] and [over.match.ref].

gcc/cp/ChangeLog
2020-02-26  Jason Merrill  

PR c++/86521 - wrong overload resolution with ref-qualifiers.
* call.c (build_user_type_conversion_1): Don't use a conversion to a
reference of the wrong rvalueness for direct binding.

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2020-02-24 Thread rverschelde at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

Rémi Verschelde  changed:

   What|Removed |Added

 CC||rverschelde at gmail dot com

--- Comment #14 from Rémi Verschelde  ---
I can confirm that the issue is still valid in the latest snapshot for 8.4
(20200221).

Here's another reproduction code we came up with independently, but it's quite
similar to the one in comment 3:
https://github.com/godotengine/godot/pull/36436#issuecomment-589913281

PR c++/86521 still slated for inclusion in 8.4.0?

We tested it and included it in the Mageia 7 gcc package, it does seem to fix
the issue. http://svnweb.mageia.org/packages?view=revision=1549659

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2019-06-18 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #13 from Marek Polacek  ---
(In reply to Hannes Hauswedell from comment #12)
> Is this resolved for GCC 8.4 now?

Not yet.

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2019-06-18 Thread h2+bugs at fsfe dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

--- Comment #12 from Hannes Hauswedell  ---
Is this resolved for GCC 8.4 now?

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2019-06-17 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

Marek Polacek  changed:

   What|Removed |Added

 CC||h2+bugs at fsfe dot org

--- Comment #11 from Marek Polacek  ---
*** Bug 90897 has been marked as a duplicate of this bug. ***

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2019-04-03 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

Jason Merrill  changed:

   What|Removed |Added

 CC||jleahy+gcc at gmail dot com

--- Comment #10 from Jason Merrill  ---
*** Bug 89596 has been marked as a duplicate of this bug. ***

[Bug c++/86521] [8 Regression] GCC 8 selects incorrect overload of ref-qualified conversion operator template

2019-03-25 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86521

Jason Merrill  changed:

   What|Removed |Added

Summary|[8/9 Regression] GCC 8  |[8 Regression] GCC 8
   |selects incorrect overload  |selects incorrect overload
   |of ref-qualified conversion |of ref-qualified conversion
   |operator template   |operator template

--- Comment #9 from Jason Merrill  ---
Fixed on trunk so far.