From patchwork Mon Jul 31 21:52:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Polacek X-Patchwork-Id: 128879 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2285103vqg; Mon, 31 Jul 2023 14:52:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEBIT9xPLXylcs3S90JdotsTLAjEhhvo7dSXH31C82lbRlzIV8ELITWEWAPOfwkSu9tf8GU X-Received: by 2002:a17:907:78cd:b0:98b:dc6c:b304 with SMTP id kv13-20020a17090778cd00b0098bdc6cb304mr807361ejc.38.1690840378461; Mon, 31 Jul 2023 14:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690840378; cv=none; d=google.com; s=arc-20160816; b=e7LTyOkQ25+wasN9sqWzGl436QS11C+SkiQCWLzS1HBpQhR3yvJuQAbdTEJB7WqJbf OHMS0KAzGAKx90CNjIK/qy1ANEtnj0ybHODCClqF5xl5E51enVYVQetnqc4pysZ3YmeI P9A/OaVHrUu/j8u5Bw95y69wWlG7+miJunYQ6V2h7ID6j5I1EHoRMiaZVYhdN2wdGL77 mLTdQtwGbh0iw5CQYyFHf3a5B1jT/PUfJDxwCVzoq86ZzcmR23MRESdUdQxRBSe9hbG1 awGfitSh0lQEh5ZMd8x1JbY2/pWh8B0eFgfoJVQV+K13vbbRgG93byEV0s5h/47d+5Q7 2lAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=rOR6BqN2lcf7gS5jnLJXYIKtZ+pJ9ABegxykYM7Pxqg=; fh=1drzuSgAqPtVUclta6Ecfzgh/wYNtWpRJF7yhohVT0I=; b=0B3itliNIHI4TOvATi8aR1K6gmXpXYqe/iRu6ry91iu5pJd7kbzMEJ2aSJYrwI7/83 apa2mttXgEId6XBVz7WtHSo9XR7Q//hMsikrL/yiM4U1Iv6fQlq+1JqiCBnyjF7b551+ 4Y5j5shHH4WDQxB6Y8Uf9XNBANnLGkbiT5iposxvCDZHRRmgDpLSKnJnKkH2uAhNP1rU XazWhFgQt3h6moxQTNV7Jb2cs3mmPXjRqeouXr2vMsEga/TiFf3GhE03b9W0ldmWZj0M wYxGRN+4MDo8GS07K5tjjFi9yJZtxNManfurOluWB93CYAxjbzKyfvjDO/2Kpxa6mnBA h91Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="RILjE+/J"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b22-20020a170906491600b00992bf8cc68csi7308386ejq.973.2023.07.31.14.52.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 14:52:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="RILjE+/J"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE2E13858416 for ; Mon, 31 Jul 2023 21:52:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE2E13858416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690840376; bh=rOR6BqN2lcf7gS5jnLJXYIKtZ+pJ9ABegxykYM7Pxqg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=RILjE+/JUigXVuqGI75HWNM0uOWvZaqrAu6u+dEkPSF0S7PtNTAvSXbqHGFdZztMI jv+kCxGmvjHAkWmsmiW3gkCNd79nBpdtGbSTVBaH4Jx7LjN93EzsfV+IPN26RuG/mP K31WeZSOcQ6rrTOKBsOhV0h/lQ4Ik/IFlZBG3ECU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9F9963858D28 for ; Mon, 31 Jul 2023 21:52:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F9963858D28 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-489-YllJm4_5NUyERoAmDELhRw-1; Mon, 31 Jul 2023 17:52:12 -0400 X-MC-Unique: YllJm4_5NUyERoAmDELhRw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C36C1044590 for ; Mon, 31 Jul 2023 21:52:12 +0000 (UTC) Received: from pdp-11.redhat.com (unknown [10.22.10.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11A9C1454143; Mon, 31 Jul 2023 21:52:12 +0000 (UTC) To: GCC Patches , Jason Merrill Subject: [PATCH] c++: parser cleanup, remove dummy arguments Date: Mon, 31 Jul 2023 17:52:06 -0400 Message-ID: <20230731215206.1876739-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Marek Polacek via Gcc-patches From: Marek Polacek Reply-To: Marek Polacek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772974640619457882 X-GMAIL-MSGID: 1772974640619457882 Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Now that cp_parser_constant_expression accepts a null non_constant_p, we can transitively remove dummy arguments in the call chain. Running dg.exp and counting the # of is_rvalue_constant_expression calls from cp_parser_constant_expression: pre-r14-2800: 2,459,145 this patch : 1,719,454 gcc/cp/ChangeLog: * parser.cc (cp_parser_postfix_expression): Adjust the call to cp_parser_braced_list. (cp_parser_postfix_open_square_expression): Likewise. (cp_parser_new_initializer): Likewise. (cp_parser_assignment_expression): Adjust the call to cp_parser_initializer_clause. (cp_parser_lambda_introducer): Adjust the call to cp_parser_initializer. (cp_parser_range_for): Adjust the call to cp_parser_braced_list. (cp_parser_jump_statement): Likewise. (cp_parser_mem_initializer): Likewise. (cp_parser_template_argument): Likewise. (cp_parser_default_argument): Adjust the call to cp_parser_initializer. (cp_parser_initializer): Handle null is_direct_init and non_constant_p arguments. (cp_parser_initializer_clause): Handle null non_constant_p argument. (cp_parser_braced_list): Likewise. (cp_parser_initializer_list): Likewise. (cp_parser_member_declaration): Adjust the call to cp_parser_initializer_clause and cp_parser_initializer. (cp_parser_yield_expression): Adjust the call to cp_parser_braced_list. (cp_parser_functional_cast): Likewise. (cp_parser_late_parse_one_default_arg): Adjust the call to cp_parser_initializer. (cp_parser_omp_for_loop_init): Likewise. (cp_parser_omp_declare_reduction_exprs): Likewise. --- gcc/cp/parser.cc | 102 +++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 61 deletions(-) base-commit: ffc74822468a39324722eef4c4412ea3224ca976 diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index b1d2e141e35..957eb705b2a 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -2483,11 +2483,11 @@ static tree cp_parser_default_argument static void cp_parser_function_body (cp_parser *, bool); static tree cp_parser_initializer - (cp_parser *, bool *, bool *, bool = false); + (cp_parser *, bool * = nullptr, bool * = nullptr, bool = false); static cp_expr cp_parser_initializer_clause - (cp_parser *, bool *); + (cp_parser *, bool * = nullptr); static cp_expr cp_parser_braced_list - (cp_parser*, bool*); + (cp_parser*, bool * = nullptr); static vec *cp_parser_initializer_list (cp_parser *, bool *, bool *); @@ -7734,12 +7734,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, /* If things aren't going well, there's no need to keep going. */ if (!cp_parser_error_occurred (parser)) - { - bool non_constant_p; - /* Parse the brace-enclosed initializer list. */ - initializer = cp_parser_braced_list (parser, - &non_constant_p); - } + /* Parse the brace-enclosed initializer list. */ + initializer = cp_parser_braced_list (parser); /* If that worked, we're definitely looking at a compound-literal expression. */ if (cp_parser_parse_definitely (parser)) @@ -8203,10 +8199,9 @@ cp_parser_postfix_open_square_expression (cp_parser *parser, } else if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { - bool expr_nonconst_p; cp_lexer_set_source_position (parser->lexer); maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); - index = cp_parser_braced_list (parser, &expr_nonconst_p); + index = cp_parser_braced_list (parser); } else index = cp_parser_expression (parser, NULL, /*cast_p=*/false, @@ -9640,12 +9635,10 @@ cp_parser_new_initializer (cp_parser* parser) if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { - tree t; - bool expr_non_constant_p; cp_lexer_set_source_position (parser->lexer); maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); - t = cp_parser_braced_list (parser, &expr_non_constant_p); - CONSTRUCTOR_IS_DIRECT_INIT (t) = 1; + tree t = cp_parser_braced_list (parser); + CONSTRUCTOR_IS_DIRECT_INIT (t) = true; expression_list = make_tree_vector_single (t); } else @@ -10505,11 +10498,8 @@ cp_parser_assignment_expression (cp_parser* parser, cp_id_kind * pidk, = cp_parser_assignment_operator_opt (parser); if (assignment_operator != ERROR_MARK) { - bool non_constant_p; - /* Parse the right-hand side of the assignment. */ - cp_expr rhs = cp_parser_initializer_clause (parser, - &non_constant_p); + cp_expr rhs = cp_parser_initializer_clause (parser); if (BRACE_ENCLOSED_INITIALIZER_P (rhs)) maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); @@ -11413,14 +11403,15 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr) || cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN) || cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { - bool direct, non_constant; /* An explicit initializer exists. */ if (cxx_dialect < cxx14) pedwarn (input_location, OPT_Wc__14_extensions, "lambda capture initializers " "only available with %<-std=c++14%> or %<-std=gnu++14%>"); - capture_init_expr = cp_parser_initializer (parser, &direct, - &non_constant, true); + capture_init_expr = cp_parser_initializer (parser, + /*direct_init=*/nullptr, + /*non_constant=*/nullptr, + /*subexpression_p=*/true); explicit_init_p = true; if (capture_init_expr == NULL_TREE) { @@ -13726,10 +13717,7 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl, } if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) - { - bool expr_non_constant_p; - range_expr = cp_parser_braced_list (parser, &expr_non_constant_p); - } + range_expr = cp_parser_braced_list (parser); else range_expr = cp_parser_expression (parser); @@ -14437,13 +14425,12 @@ cp_parser_jump_statement (cp_parser* parser) case RID_RETURN: { tree expr; - bool expr_non_constant_p; if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { cp_lexer_set_source_position (parser->lexer); maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); - expr = cp_parser_braced_list (parser, &expr_non_constant_p); + expr = cp_parser_braced_list (parser); } else if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)) expr = cp_parser_expression (parser); @@ -17056,10 +17043,9 @@ cp_parser_mem_initializer (cp_parser* parser) if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { - bool expr_non_constant_p; cp_lexer_set_source_position (parser->lexer); maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); - expression_list = cp_parser_braced_list (parser, &expr_non_constant_p); + expression_list = cp_parser_braced_list (parser); CONSTRUCTOR_IS_DIRECT_INIT (expression_list) = 1; expression_list = build_tree_list (NULL_TREE, expression_list); } @@ -19197,10 +19183,7 @@ cp_parser_template_argument (cp_parser* parser) /* In C++20, we can encounter a braced-init-list. */ if (cxx_dialect >= cxx20 && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) - { - bool expr_non_constant_p; - return cp_parser_braced_list (parser, &expr_non_constant_p); - } + return cp_parser_braced_list (parser); /* With C++17 generalized non-type template arguments we need to handle lvalue constant expressions, too. */ @@ -25314,7 +25297,6 @@ cp_parser_default_argument (cp_parser *parser, bool template_parm_p) tree default_argument = NULL_TREE; bool saved_greater_than_is_operator_p; unsigned char saved_local_variables_forbidden_p; - bool non_constant_p, is_direct_init; /* Make sure that PARSER->GREATER_THAN_IS_OPERATOR_P is set correctly. */ @@ -25341,8 +25323,7 @@ cp_parser_default_argument (cp_parser *parser, bool template_parm_p) saved_class_ref = current_class_ref; cp_function_chain->x_current_class_ref = NULL_TREE; } - default_argument - = cp_parser_initializer (parser, &is_direct_init, &non_constant_p); + default_argument = cp_parser_initializer (parser); /* Restore the "this" pointer. */ if (cfun) { @@ -25441,8 +25422,8 @@ cp_parser_ctor_initializer_opt_and_function_body (cp_parser *parser, is set to true; otherwise it is set to false. */ static tree -cp_parser_initializer (cp_parser* parser, bool* is_direct_init, - bool* non_constant_p, bool subexpression_p) +cp_parser_initializer (cp_parser *parser, bool *is_direct_init /*=nullptr*/, + bool *non_constant_p /*=nullptr*/, bool subexpression_p) { cp_token *token; tree init; @@ -25452,9 +25433,11 @@ cp_parser_initializer (cp_parser* parser, bool* is_direct_init, /* Let our caller know whether or not this initializer was parenthesized. */ - *is_direct_init = (token->type != CPP_EQ); + if (is_direct_init) + *is_direct_init = (token->type != CPP_EQ); /* Assume that the initializer is constant. */ - *non_constant_p = false; + if (non_constant_p) + *non_constant_p = false; if (token->type == CPP_EQ) { @@ -25514,7 +25497,8 @@ cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p) cp_expr initializer; /* Assume the expression is constant. */ - *non_constant_p = false; + if (non_constant_p) + *non_constant_p = false; /* If it is not a `{', then we are looking at an assignment-expression. */ @@ -25546,7 +25530,7 @@ cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p) cp_parser_initializer. */ static cp_expr -cp_parser_braced_list (cp_parser* parser, bool* non_constant_p) +cp_parser_braced_list (cp_parser *parser, bool *non_constant_p /*=nullptr*/) { tree initializer; location_t start_loc = cp_lexer_peek_token (parser->lexer)->location; @@ -25568,7 +25552,7 @@ cp_parser_braced_list (cp_parser* parser, bool* non_constant_p) if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) cp_lexer_consume_token (parser->lexer); } - else + else if (non_constant_p) *non_constant_p = false; /* Now, there should be a trailing `}'. */ location_t finish_loc = cp_lexer_peek_token (parser->lexer)->location; @@ -25706,7 +25690,8 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p, tree first_designator = NULL_TREE; /* Assume all of the expressions are constant. */ - *non_constant_p = false; + if (non_constant_p) + *non_constant_p = false; unsigned nelts = 0; int suppress = suppress_location_wrappers; @@ -25814,7 +25799,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p, initializer = cp_parser_initializer_clause (parser, &clause_non_constant_p); /* If any clause is non-constant, so is the entire initializer. */ - if (clause_non_constant_p) + if (clause_non_constant_p && non_constant_p) *non_constant_p = true; /* If we have an ellipsis, this is an initializer pack @@ -27689,14 +27674,12 @@ cp_parser_member_declaration (cp_parser* parser) initializer = cp_parser_save_nsdmi (parser); else if (cxx_dialect >= cxx11) { - bool nonconst; /* Don't require a constant rvalue in C++11, since we might want a reference constant. We'll enforce constancy later. */ cp_lexer_consume_token (parser->lexer); /* Parse the initializer. */ - initializer = cp_parser_initializer_clause (parser, - &nonconst); + initializer = cp_parser_initializer_clause (parser); } else /* Parse the initializer. */ @@ -27705,13 +27688,12 @@ cp_parser_member_declaration (cp_parser* parser) else if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE) && !function_declarator_p (declarator)) { - bool x; declarator->init_loc = cp_lexer_peek_token (parser->lexer)->location; if (decl_specifiers.storage_class != sc_static) initializer = cp_parser_save_nsdmi (parser); else - initializer = cp_parser_initializer (parser, &x, &x); + initializer = cp_parser_initializer (parser); } /* Detect invalid bit-field cases such as @@ -28721,11 +28703,10 @@ cp_parser_yield_expression (cp_parser* parser) if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { - bool expr_non_constant_p; cp_lexer_set_source_position (parser->lexer); /* ??? : probably a moot point? */ maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); - expr = cp_parser_braced_list (parser, &expr_non_constant_p); + expr = cp_parser_braced_list (parser); } else expr = cp_parser_assignment_expression (parser); @@ -32641,7 +32622,6 @@ cp_parser_functional_cast (cp_parser* parser, tree type) vec *vec; tree expression_list; cp_expr cast; - bool nonconst_p; location_t start_loc = input_location; @@ -32652,7 +32632,7 @@ cp_parser_functional_cast (cp_parser* parser, tree type) { cp_lexer_set_source_position (parser->lexer); maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); - expression_list = cp_parser_braced_list (parser, &nonconst_p); + expression_list = cp_parser_braced_list (parser); CONSTRUCTOR_IS_DIRECT_INIT (expression_list) = 1; if (TREE_CODE (type) == TYPE_DECL) type = TREE_TYPE (type); @@ -33087,7 +33067,6 @@ cp_parser_late_parse_one_default_arg (cp_parser *parser, tree decl, { cp_token_cache *tokens; tree parsed_arg; - bool dummy; if (default_arg == error_mark_node) return error_mark_node; @@ -33100,7 +33079,7 @@ cp_parser_late_parse_one_default_arg (cp_parser *parser, tree decl, start_lambda_scope (decl); /* Parse the default argument. */ - parsed_arg = cp_parser_initializer (parser, &dummy, &dummy); + parsed_arg = cp_parser_initializer (parser); if (BRACE_ENCLOSED_INITIALIZER_P (parsed_arg)) maybe_warn_cpp0x (CPP0X_INITIALIZER_LISTS); @@ -43142,10 +43121,10 @@ cp_parser_omp_for_loop_init (cp_parser *parser, || type_dependent_expression_p (decl) || auto_node) { - bool is_direct_init, is_non_constant_init; + bool is_non_constant_init; init = cp_parser_initializer (parser, - &is_direct_init, + /*is_direct_init=*/nullptr, &is_non_constant_init); if (auto_node) @@ -47739,7 +47718,7 @@ cp_parser_omp_declare_reduction_exprs (tree fndecl, cp_parser *parser) bool ctor = false; if (strcmp (p, "omp_priv") == 0) { - bool is_direct_init, is_non_constant_init; + bool is_non_constant_init; ctor = true; cp_lexer_consume_token (parser->lexer); /* Reject initializer (omp_priv) and initializer (omp_priv ()). */ @@ -47754,7 +47733,8 @@ cp_parser_omp_declare_reduction_exprs (tree fndecl, cp_parser *parser) error ("invalid initializer clause"); return false; } - initializer = cp_parser_initializer (parser, &is_direct_init, + initializer = cp_parser_initializer (parser, + /*is_direct_init=*/nullptr, &is_non_constant_init); cp_finish_decl (omp_priv, initializer, !is_non_constant_init, NULL_TREE, LOOKUP_ONLYCONVERTING);