https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109761
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:60a8421ee457d94880e4dcbb93a663c633f2e96e commit r11-10944-g60a8421ee457d94880e4dcbb93a663c633f2e96e Author: Patrick Palka <ppa...@redhat.com> Date: Tue May 9 15:06:34 2023 -0400 c++: noexcept-spec from nested class confusion [PR109761] When late processing a noexcept-spec from a nested class after completion of the outer class (since it's a complete-class context), we pass the wrong class context to noexcept_override_late_checks -- the outer class type instead of the nested class type -- which leads to bogus errors in the below test. This patch fixes this by making noexcept_override_late_checks obtain the class context directly via DECL_CONTEXT instead of via an additional parameter. PR c++/109761 gcc/cp/ChangeLog: * parser.c (cp_parser_class_specifier): Don't pass a class context to noexcept_override_late_checks. (noexcept_override_late_checks): Remove 'type' parameter and use DECL_CONTEXT of 'fndecl' instead. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/noexcept78.C: New test. (cherry picked from commit c13906f258fb34b3e0c90ddc8d9191dd72f3da0e)