From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 6C4E138582A0; Tue, 1 Nov 2022 11:43:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C4E138582A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667303016; bh=uTHaqu8EjibsCCEJTGtVWTZs7O08R11t55F8veleBuM=; h=From:To:Subject:Date:From; b=Hc3p3FXZkRgEe0+2LxrFcWxQob7Zn3PnOM0y+KExrBwKD+b4A3EOOtYzwAe0H+aej alHcZRkDmNG8Msfzvlw540v72De4dvzwbpa7WvU11RUAuhBSPaxiVcetFf0gxIib/G pagV73MW75pkyj732zq4Hcod7V9orOXlG73rD/3k= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/c++-contracts] c++: don't add contracted fns to unparsed_funs. X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/devel/c++-contracts X-Git-Oldrev: 5080aec5f3f0eae334883c099f93070e6c3a5b64 X-Git-Newrev: f5a360ff9bab5eb255ae86685f25c3e22fcfc554 Message-Id: <20221101114336.6C4E138582A0@sourceware.org> Date: Tue, 1 Nov 2022 11:43:36 +0000 (GMT) List-Id: https://gcc.gnu.org/g:f5a360ff9bab5eb255ae86685f25c3e22fcfc554 commit f5a360ff9bab5eb255ae86685f25c3e22fcfc554 Author: Jason Merrill Date: Fri Oct 28 12:08:06 2022 -0400 c++: don't add contracted fns to unparsed_funs. 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. Diff: --- gcc/cp/parser.h | 1 + gcc/cp/parser.cc | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h index d31f007c1ef..1b6c359a4c0 100644 --- a/gcc/cp/parser.h +++ b/gcc/cp/parser.h @@ -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. */ diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index a911a660178..0f707b57c4c 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -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)