From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 68CE9385782F; Tue, 1 Nov 2022 01:24:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68CE9385782F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667265848; bh=0AkrC/Nq2xlWqcnDBIIfqnNYmQ9iQWNoEhC6rgFX534=; h=From:To:Subject:Date:From; b=xS4VAjfIr+iIJUX2NmICzyoajiSceCK6Yp8FD7OVH5WEwSzvbHCkbzoDBPZ1YSvOR EDDs3QNUGI3P2I/miqZnNVze+BIZP0JG3wWStBBQb9saLz/Z2VQN/MAvHwUnv0SHvr 2Ze9xhC00pCKmpbDpwUV5aUOHtM+eTNl1Obip2ak= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3585] c++: pass std attributes to make_call_declarator X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: 43c40f114a68edc9a9cc9963dc940c11806ff863 X-Git-Newrev: af6d747df7e311a6555dda3a75f6724ecc4481bd Message-Id: <20221101012408.68CE9385782F@sourceware.org> Date: Tue, 1 Nov 2022 01:24:08 +0000 (GMT) List-Id: https://gcc.gnu.org/g:af6d747df7e311a6555dda3a75f6724ecc4481bd commit r13-3585-gaf6d747df7e311a6555dda3a75f6724ecc4481bd Author: Jason Merrill Date: Mon Oct 31 13:40:10 2022 -0400 c++: pass std attributes to make_call_declarator It seems preferable to pass these to the function rather than set them separately after the call. gcc/cp/ChangeLog: * parser.cc (make_call_declarator): Add std_attrs parm. (cp_parser_lambda_declarator_opt): Pass it. (cp_parser_direct_declarator): Pass it. Diff: --- gcc/cp/parser.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 6a5b0652a09..6da32801bab 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -1607,7 +1607,7 @@ clear_decl_specs (cp_decl_specifier_seq *decl_specs) static cp_declarator *make_call_declarator (cp_declarator *, tree, cp_cv_quals, cp_virt_specifiers, cp_ref_qualifier, - tree, tree, tree, tree, location_t); + tree, tree, tree, tree, tree, location_t); static cp_declarator *make_array_declarator (cp_declarator *, tree); static cp_declarator *make_pointer_declarator @@ -1780,7 +1780,8 @@ make_ptrmem_declarator (cp_cv_quals cv_qualifiers, tree class_type, /* Make a declarator for the function given by TARGET, with the indicated PARMS. The CV_QUALIFIERS apply to the function, as in "const"-qualified member function. The EXCEPTION_SPECIFICATION - indicates what exceptions can be thrown. */ + indicates what exceptions can be thrown. STD_ATTRS contains + attributes that appertain to the function type. */ cp_declarator * make_call_declarator (cp_declarator *target, @@ -1792,6 +1793,7 @@ make_call_declarator (cp_declarator *target, tree exception_specification, tree late_return_type, tree requires_clause, + tree std_attrs, location_t parens_loc) { cp_declarator *declarator; @@ -1816,6 +1818,8 @@ make_call_declarator (cp_declarator *target, else declarator->parameter_pack_p = false; + declarator->std_attributes = std_attrs; + return declarator; } @@ -11684,8 +11688,8 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr) exception_spec, return_type, trailing_requires_clause, + std_attrs, UNKNOWN_LOCATION); - declarator->std_attributes = std_attrs; fco = grokmethod (&return_type_specs, declarator, @@ -23264,8 +23268,8 @@ cp_parser_direct_declarator (cp_parser* parser, exception_specification, late_return, requires_clause, + attrs, parens_loc); - declarator->std_attributes = attrs; declarator->attributes = gnu_attrs; /* Any subsequent parameter lists are to do with return type, so are not those of the declared