https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110468
--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:23c64450cbce916547142519a72075d1930c8282 commit r13-7517-g23c64450cbce916547142519a72075d1930c8282 Author: Patrick Palka <ppa...@redhat.com> 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)