]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: noexcept and pointer to member function type [PR113108]
authorMarek Polacek <polacek@redhat.com>
Tue, 3 Sep 2024 17:04:09 +0000 (13:04 -0400)
committerMarek Polacek <polacek@redhat.com>
Wed, 4 Sep 2024 17:06:31 +0000 (13:06 -0400)
commitc755c7a32590e2eef5a8b062b9756c1513910246
tree44b8a19ea953e8c452457d6078f564f8482558ba
parent858918ef4233c837ab85819ad159bf452df3a7fb
c++: noexcept and pointer to member function type [PR113108]

We ICE in nothrow_spec_p because it got a DEFERRED_NOEXCEPT.
This DEFERRED_NOEXCEPT was created in implicitly_declare_fn
when declaring

  Foo& operator=(Foo&&) = default;

in the test.  The problem is that in resolve_overloaded_unification
we call maybe_instantiate_noexcept before try_one_overload only in
the TEMPLATE_ID_EXPR case.

PR c++/113108

gcc/cp/ChangeLog:

* pt.cc (resolve_overloaded_unification): Call
maybe_instantiate_noexcept.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/noexcept-type28.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp1z/noexcept-type28.C [new file with mode: 0644]