]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: don't add contracted fns to unparsed_funs.
authorJason Merrill <jason@redhat.com>
Fri, 28 Oct 2022 16:08:06 +0000 (12:08 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 31 Oct 2022 16:00:30 +0000 (12:00 -0400)
They get their own late parse.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_member_declaration): Don't add
fn with contracts to unparsed_funs_with_definitions.

gcc/cp/parser.cc
gcc/cp/parser.h

index a911a660178f8b7e8403f6c3c4bc7d793f00b9ec..0f707b57c4c83e5774f1a4ca0263aa320d47d602 100644 (file)
@@ -27668,12 +27668,6 @@ cp_parser_member_declaration (cp_parser* parser)
                                initializer, /*init_const_expr_p=*/true,
                                asm_specification, attributes);
 
-             /* If we've declared a member function with contracts, ensure we
-                do late parsing for the contracts even if we have no function
-                body to parse at that time.  */
-             if (DECL_DECLARES_FUNCTION_P (decl) && DECL_CONTRACTS (decl))
-               vec_safe_push (unparsed_funs_with_definitions, decl);
-
              if (parser->fully_implicit_function_template_p)
                {
                  if (friend_p)
index d31f007c1ef6f5b3867a85141a562b4eaba91cba..1b6c359a4c0345db6144495c8bf34181f2d79212 100644 (file)
@@ -318,6 +318,7 @@ struct GTY(()) cp_parser {
   /* TRUE if the decl-specifier-seq preceding a declarator includes
      the 'friend' specifier. This prevents attributes on friend function
      declarations from being parsed in the complete class context.  */
+  /* ??? Maybe use defer_guarded_contract_match instead?  */
   bool declaring_friend_p;
 
   /* TRUE if we are presently parsing a template-argument-list.  */