https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114114
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[12/13 Regression] Internal |[12 Regression] Internal
|compiler error on |compiler error on
|function-local conditional |function-local conditional
|noexcept |noexcept
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed by:
The releases/gcc-13 branch has been updated by Marek Polacek
<[email protected]>:
https://gcc.gnu.org/g:0430ec8881d657ddedff6c9d9fa4ea5db125f462
commit r13-9304-g0430ec8881d657ddedff6c9d9fa4ea5db125f462
Author: Marek Polacek <[email protected]>
Date: Fri Jan 10 17:26:18 2025 -0500
c++: ICE with noexcept and local specialization, again [PR114349]
Patrick noticed that my r14-9339-gdc6c3bfb59baab patch is wrong;
we're dealing with a noexcept-spec there, not a noexcept-expr, so
setting cp_noexcept_operand et al is incorrect. Back to the drawing
board then.
To fix noexcept84.C, we should probably avoid doing push_to_top_level
in certain cases. maybe_push_to_top_level didn't work here as-is, so
I changed it to not push to top level if decl_function_context is
non-null, when we are not dealing with a lambda.
This also fixes c++/114349, introduced by r14-9339.
This GCC 13 backport squashes r14-9659 and r14-9339.
PR c++/114349
gcc/cp/ChangeLog:
* name-lookup.cc (maybe_push_to_top_level): For a non-lambda,
don't push to top level if decl_function_context is non-null.
* pt.cc (maybe_instantiate_noexcept): Use maybe_push_to_top_level.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/noexcept84.C: New test.
* g++.dg/cpp0x/noexcept85.C: New test.
* g++.dg/cpp0x/noexcept86.C: New test.