[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

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

--- Comment #6 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Marek Polacek
:

https://gcc.gnu.org/g:53512f0055186d5556e9859c1f8beb25d2d28530

commit r11-10525-g53512f0055186d5556e9859c1f8beb25d2d28530
Author: Marek Polacek 
Date:   Fri Feb 10 17:26:57 2023 -0500

c++: fix ICE in joust_maybe_elide_copy [PR106675]

joust_maybe_elide_copy checks that the last conversion in the ICS for
the first argument is ck_ref_bind, which is reasonable, because we've
checked that we're dealing with a copy/move constructor.  But it can
also happen that we couldn't figure out which conversion function is
better to convert the argument, as in this testcase: joust couldn't
decide if we should go with

  operator foo &()

or

  operator foo const &()

so we get a ck_ambig, which then upsets joust_maybe_elide_copy.  Since
a ck_ambig can validly occur, I think we should just return early, as
in the patch below.

PR c++/106675

gcc/cp/ChangeLog:

* call.c (joust_maybe_elide_copy): Return false for ck_ambig.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit cce62625025380c2ea2a220deb10f8f355f83abf)

[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

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

--- Comment #5 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Marek Polacek
:

https://gcc.gnu.org/g:1721d85708116a1edbe5ba30f055d47e6c1e29b6

commit r12-9174-g1721d85708116a1edbe5ba30f055d47e6c1e29b6
Author: Marek Polacek 
Date:   Fri Feb 10 17:26:57 2023 -0500

c++: fix ICE in joust_maybe_elide_copy [PR106675]

joust_maybe_elide_copy checks that the last conversion in the ICS for
the first argument is ck_ref_bind, which is reasonable, because we've
checked that we're dealing with a copy/move constructor.  But it can
also happen that we couldn't figure out which conversion function is
better to convert the argument, as in this testcase: joust couldn't
decide if we should go with

  operator foo &()

or

  operator foo const &()

so we get a ck_ambig, which then upsets joust_maybe_elide_copy.  Since
a ck_ambig can validly occur, I think we should just return early, as
in the patch below.

PR c++/106675

gcc/cp/ChangeLog:

* call.cc (joust_maybe_elide_copy): Return false for ck_ambig.

gcc/testsuite/ChangeLog:

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

(cherry picked from commit cce62625025380c2ea2a220deb10f8f355f83abf)

[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

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

--- Comment #4 from CVS Commits  ---
The trunk branch has been updated by Marek Polacek :

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

commit r13-5990-gcce62625025380c2ea2a220deb10f8f355f83abf
Author: Marek Polacek 
Date:   Fri Feb 10 17:26:57 2023 -0500

c++: fix ICE in joust_maybe_elide_copy [PR106675]

joust_maybe_elide_copy checks that the last conversion in the ICS for
the first argument is ck_ref_bind, which is reasonable, because we've
checked that we're dealing with a copy/move constructor.  But it can
also happen that we couldn't figure out which conversion function is
better to convert the argument, as in this testcase: joust couldn't
decide if we should go with

  operator foo &()

or

  operator foo const &()

so we get a ck_ambig, which then upsets joust_maybe_elide_copy.  Since
a ck_ambig can validly occur, I think we should just return early, as
in the patch below.

PR c++/106675

gcc/cp/ChangeLog:

* call.cc (joust_maybe_elide_copy): Return false for ck_ambig.

gcc/testsuite/ChangeLog:

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

[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

2023-02-10 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106675

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

2022-08-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106675

Martin Liška  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org

--- Comment #3 from Martin Liška  ---
Likely started with r9-6526-gdcfa8518868d9eb8 with -std=c++17.

[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

2022-08-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106675

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

2022-08-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106675

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=86521

--- Comment #2 from Andrew Pinski  ---
I suspect the patch for PR 86521 which was aiming on fixing the rejection was
not fully correct and introduced an ICE in some cases ...

[Bug c++/106675] [10/11/12/13 Regression] g++ crashes on funky operators

2022-08-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106675

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2022-08-18
Summary|g++ crashes on funky|[10/11/12/13 Regression]
   |operators   |g++ crashes on funky
   ||operators
  Known to fail||12.1.0, 8.4.0, 8.5.0, 9.1.0
   Target Milestone|--- |10.5
   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
(In reply to Isabella from comment #0)
> g++ from v11 onward crashes on it: https://godbolt.org/z/nYqo1zj31

That is because the language default changed to gnu++17 from gnu++14.

Confirmed. It might be considered a regression even though it was rejected
before GCC 8.4.0.

The ICE is in joust_maybe_elide_copy.