[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

2023-06-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110468

--- Comment #9 from Andrew Pinski  ---
Created attachment 55422
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55422&action=edit
Reduced testcase

Attached is the reduced testcase (which was modified back to be valid).

[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

2023-06-28 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110468

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||10.4.0, 11.4.0
   Target Milestone|--- |12.4
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed|2023-06-28 00:00:00 |2023-06-29
  Known to fail||12.1.0, 12.3.0, 13.1.0,
   ||14.0

--- Comment #10 from Andrew Pinski  ---
Confirmed.

Note in the reduced testcase, m needs to be a template, variant needs to be a
template but not depedent and hh::value needs to be a value depedent.
Also note it works with -std=c++11 .

Slightly more reduced, changing `hh::value` to just `T>0` as mentioned it
just needs to be value depedent:
```
template  struct variant {
  variant() noexcept(T>0) {}
};
template  
struct m {
  variant<1> def{};
};
struct v {
  v(m<1>);
};
v t = {{}};
```

[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

2023-06-28 Thread gococobu at 7art dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110468

--- Comment #11 from gococobu at 7art dot org ---
Thank you very much for your work, Andrew. I'll remove the files from the
posted URL now.

[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

2023-06-29 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110468

Patrick Palka  changed:

   What|Removed |Added

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

--- Comment #12 from Patrick Palka  ---
Started with r12-3559-g22806064a67cf3

[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

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

--- Comment #13 from CVS Commits  ---
The master branch has been updated by Patrick Palka :

https://gcc.gnu.org/g:9479da4515f7d019b4ef282d0e21536431c44f71

commit r14-2199-g9479da4515f7d019b4ef282d0e21536431c44f71
Author: Patrick Palka 
Date:   Thu Jun 29 16:10:18 2023 -0400

c++: NSDMI instantiation during overload resolution [PR110468]

Here we find ourselves instantiating the NSDMI for A<1>::m when
computing argument conversions during overload resolution, and
thus tf_conv is set.  The flag causes mark_used for the constructor
used in the NSDMI to exit early and not instantiate its noexcept-spec,
which eventually leads to an ICE from nothrow_spec_p.

This patch fixes this by clearing any special tsubst flags during
instantiation of an NSDMI, since the result should be independent of
the context that requires the instantiation.

PR c++/110468

gcc/cp/ChangeLog:

* init.cc (maybe_instantiate_nsdmi_init): Mask out all
tsubst flags except for tf_warning_or_error.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/noexcept79.C: New test.

[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

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

--- Comment #14 from CVS Commits  ---
The releases/gcc-13 branch has been updated by Patrick Palka
:

https://gcc.gnu.org/g:23c64450cbce916547142519a72075d1930c8282

commit r13-7517-g23c64450cbce916547142519a72075d1930c8282
Author: Patrick Palka 
Date:   Thu Jun 29 16:10:18 2023 -0400

c++: NSDMI instantiation during overload resolution [PR110468]

Here we find ourselves instantiating the NSDMI for A<1>::m when
computing argument conversions during overload resolution, and
thus tf_conv is set.  The flag causes mark_used for the constructor
used in the NSDMI to exit early and not instantiate its noexcept-spec,
which eventually leads to an ICE from nothrow_spec_p.

This patch fixes this by clearing any special tsubst flags during
instantiation of an NSDMI, since the result should be independent of
the context that requires the instantiation.

PR c++/110468

gcc/cp/ChangeLog:

* init.cc (maybe_instantiate_nsdmi_init): Mask out all
tsubst flags except for tf_warning_or_error.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/noexcept79.C: New test.

(cherry picked from commit 9479da4515f7d019b4ef282d0e21536431c44f71)

[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

2023-07-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110468

--- Comment #15 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Patrick Palka
:

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

commit r12-9767-gdfbe77ab8a70bc7eb48a96775da04095d933a3a6
Author: Patrick Palka 
Date:   Thu Jun 29 16:10:18 2023 -0400

c++: NSDMI instantiation during overload resolution [PR110468]

Here we find ourselves instantiating the NSDMI for A<1>::m when
computing argument conversions during overload resolution, and
thus tf_conv is set.  The flag causes mark_used for the constructor
used in the NSDMI to exit early and not instantiate its noexcept-spec,
which eventually leads to an ICE from nothrow_spec_p.

This patch fixes this by clearing any special tsubst flags during
instantiation of an NSDMI, since the result should be independent of
the context that requires the instantiation.

PR c++/110468

gcc/cp/ChangeLog:

* init.cc (maybe_instantiate_nsdmi_init): Mask out all
tsubst flags except for tf_warning_or_error.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/noexcept79.C: New test.

(cherry picked from commit 9479da4515f7d019b4ef282d0e21536431c44f71)

[Bug c++/110468] [12/13/14 regression] Internal compiler error in nothrow_spec_p

2023-07-12 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110468

Patrick Palka  changed:

   What|Removed |Added

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

--- Comment #16 from Patrick Palka  ---
Fixed for GCC 12.4/13.2/14, thanks for the bug report!