static tree cp_parser_late_noexcept_specifier
(cp_parser *, tree);
static void noexcept_override_late_checks
- (tree, tree);
+ (tree);
static void cp_parser_initial_pragma
(cp_token *);
/* The finish_struct call above performed various override checking,
but it skipped unparsed noexcept-specifier operands. Now that we
have resolved them, check again. */
- noexcept_override_late_checks (type, decl);
+ noexcept_override_late_checks (decl);
/* Remove any member-function parameters from the symbol table. */
pop_injected_parms ();
}
/* Perform late checking of overriding function with respect to their
- noexcept-specifiers. TYPE is the class and FNDECL is the function
- that potentially overrides some virtual function with the same
- signature. */
+ noexcept-specifiers. FNDECL is the member function that potentially
+ overrides some virtual function with the same signature. */
static void
-noexcept_override_late_checks (tree type, tree fndecl)
+noexcept_override_late_checks (tree fndecl)
{
- tree binfo = TYPE_BINFO (type);
+ tree binfo = TYPE_BINFO (DECL_CONTEXT (fndecl));
tree base_binfo;
if (DECL_STATIC_FUNCTION_P (fndecl))
--- /dev/null
+// PR c++/109761
+// { dg-do compile { target c++11 } }
+
+struct base {
+ virtual void foo() noexcept { }
+ virtual ~base() { }
+};
+
+struct outer : base {
+ struct nested {
+ void foo() noexcept(noexcept(g())); // { dg-bogus "looser" }
+ ~nested() noexcept(noexcept(g())); // { dg-bogus "looser" }
+ };
+ static void g();
+};
+