From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 35FC03858404; Thu, 13 Oct 2022 21:19:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35FC03858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665695941; bh=GgQTmToPwdjV0T4PFIEZ/Q0z90euYz9qPnTjx+klTrY=; h=From:To:Subject:Date:From; b=eQpIh7/ev8Q4ZuBIGZFbio/Yzn4Ejl/NKbGfzsOwVERdRl2g5Gab1N8VDEckgCgke n9ek7ZBYy1sgF6Myv5kqh8tAkY9KYlfXM3C0rqgjXGWAs2F+0c6bCZAun+x0sWCrNs 7002NASTN/RfFeksN4OsUlOLomixrL0rxJt8Vq9Q= 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-3286] c++: trivial formatting cleanups X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/master X-Git-Oldrev: 99da523359e9333555585484eb3b8f854a98f1b4 X-Git-Newrev: 537e08cfad04e79fb97d368e397cfc7e782865ec Message-Id: <20221013211901.35FC03858404@sourceware.org> Date: Thu, 13 Oct 2022 21:19:00 +0000 (GMT) List-Id: https://gcc.gnu.org/g:537e08cfad04e79fb97d368e397cfc7e782865ec commit r13-3286-g537e08cfad04e79fb97d368e397cfc7e782865ec Author: Jason Merrill Date: Tue Jun 29 17:45:21 2021 -0400 c++: trivial formatting cleanups Split out from the C++ contracts patch. gcc/cp/ChangeLog: * cp-tree.h: Fix whitespace. * parser.h: Fix whitespace. * decl.cc: Fix whitespace. * parser.cc: Fix whitespace. * pt.cc: Fix whitespace. Diff: --- gcc/cp/cp-tree.h | 4 ++-- gcc/cp/parser.h | 2 +- gcc/cp/decl.cc | 2 -- gcc/cp/parser.cc | 12 ++++++++---- gcc/cp/pt.cc | 12 ++++++------ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 3b67be651b9..1534c875693 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -7458,7 +7458,7 @@ extern tree get_template_argument_pack_elems (const_tree); extern tree get_function_template_decl (const_tree); extern tree resolve_nondeduced_context (tree, tsubst_flags_t); extern tree resolve_nondeduced_context_or_error (tree, tsubst_flags_t); -extern hashval_t iterative_hash_template_arg (tree arg, hashval_t val); +extern hashval_t iterative_hash_template_arg (tree arg, hashval_t val); extern tree coerce_template_parms (tree, tree, tree); extern tree coerce_template_parms (tree, tree, tree, tsubst_flags_t); extern tree canonicalize_type_argument (tree, tsubst_flags_t); @@ -7519,7 +7519,7 @@ extern tree lookup_fnfields (tree, tree, int, tsubst_flags_t); extern tree lookup_member (tree, tree, int, bool, tsubst_flags_t, access_failure_info *afi = NULL); -extern tree lookup_member_fuzzy (tree, tree, bool); +extern tree lookup_member_fuzzy (tree, tree, bool); extern tree locate_field_accessor (tree, tree, bool); extern int look_for_overrides (tree, tree); extern void get_pure_virtuals (tree); diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h index d688fd18fd5..3e95bfc131b 100644 --- a/gcc/cp/parser.h +++ b/gcc/cp/parser.h @@ -391,7 +391,7 @@ struct GTY(()) cp_parser { /* When parsing #pragma acc routine, this is a pointer to a helper data structure. */ cp_oacc_routine_data * GTY((skip)) oacc_routine; - + /* Nonzero if parsing a parameter list where 'auto' should trigger an implicit template parameter. */ bool auto_is_implicit_function_template_parm_p; diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 82eb0c2f22a..85b892cddf0 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -2319,7 +2319,6 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden) = DECL_DECLARED_INLINE_P (new_result); DECL_DISREGARD_INLINE_LIMITS (old_result) |= DECL_DISREGARD_INLINE_LIMITS (new_result); - } else { @@ -10220,7 +10219,6 @@ grokfndecl (tree ctype, return NULL_TREE; } - /* A friend declaration of the form friend void f<>(). Record the information in the TEMPLATE_ID_EXPR. */ SET_DECL_IMPLICIT_INSTANTIATION (decl); diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 4e3ed660e68..10d303884fb 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -11677,10 +11677,10 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr) declarator = make_call_declarator (declarator, param_list, quals, VIRT_SPEC_UNSPECIFIED, - REF_QUAL_NONE, + REF_QUAL_NONE, tx_qual, exception_spec, - return_type, + return_type, trailing_requires_clause, UNKNOWN_LOCATION); declarator->std_attributes = std_attrs; @@ -25410,6 +25410,7 @@ cp_parser_skip_to_closing_square_bracket (cp_parser *parser) if (!parser->lexer->in_pragma) break; /* FALLTHRU */ + case CPP_EOF: /* If we've run out of tokens, then there is no closing `]'. */ return false; @@ -27490,6 +27491,7 @@ cp_parser_member_declaration (cp_parser* parser) &decl_specifiers, declarator, attributes); + if (parser->fully_implicit_function_template_p) decl = finish_fully_implicit_template (parser, decl); /* If the member was not a friend, declare it here. */ @@ -27513,6 +27515,7 @@ cp_parser_member_declaration (cp_parser* parser) else if (declarator->kind == cdk_function) declarator->id_loc = token->location; + /* Create the declaration. */ decl = grokfield (declarator, &decl_specifiers, initializer, /*init_const_expr_p=*/true, @@ -29107,6 +29110,7 @@ cp_parser_std_attribute (cp_parser *parser, tree attr_ns) attr_id = canonicalize_attr_name (attr_id); attribute = build_tree_list (build_tree_list (NULL_TREE, attr_id), NULL_TREE); + /* We used to treat C++11 noreturn attribute as equivalent to GNU's, but no longer: we have to be able to tell [[noreturn]] and __attribute__((noreturn)) apart. */ @@ -29437,8 +29441,7 @@ cp_parser_std_attribute_spec (cp_parser *parser) /* Parse a standard C++-11 attribute-specifier-seq. attribute-specifier-seq: - attribute-specifier-seq [opt] attribute-specifier - */ + attribute-specifier-seq [opt] attribute-specifier */ static tree cp_parser_std_attribute_spec_seq (cp_parser *parser) @@ -31393,6 +31396,7 @@ cp_parser_function_definition_after_declarator (cp_parser* parser, /* Generate code for it, if necessary. */ expand_or_defer_fn (fn); + /* Restore the saved values. */ parser->in_unbraced_linkage_specification_p = saved_in_unbraced_linkage_specification_p; diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index ec337e2349e..f6800857dcf 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -1581,6 +1581,7 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend, there were no definition, and vice versa. */ DECL_INITIAL (fn) = NULL_TREE; duplicate_decls (spec, fn, /*hiding=*/is_friend); + /* The call to duplicate_decls will have applied [temp.expl.spec]: @@ -12185,6 +12186,7 @@ instantiate_class_template (tree type) r = tsubst (t, args, tf_error, NULL_TREE); if (TREE_CODE (t) == TEMPLATE_DECL) --processing_template_decl; + set_current_access_from_decl (r); finish_member_declaration (r); /* Instantiate members marked with attribute used. */ @@ -17020,7 +17022,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) /* This can happen for a parameter name used later in a function declaration (such as in a late-specified return type). Just make a dummy decl, since it's only used for its type. */ - gcc_assert (cp_unevaluated_operand != 0); + gcc_assert (cp_unevaluated_operand); r = tsubst_decl (t, args, complain); /* Give it the template pattern as its context; its true context hasn't been instantiated yet and this is good enough for @@ -21918,6 +21920,7 @@ instantiate_template (tree tmpl, tree orig_args, tsubst_flags_t complain) } return error_mark_node; } + return fndecl; } @@ -26183,12 +26186,9 @@ regenerate_decl_from_template (tree decl, tree tmpl, tree args) { /* The arguments used to instantiate DECL, from the most general template. */ - tree code_pattern; + tree code_pattern = DECL_TEMPLATE_RESULT (tmpl); - code_pattern = DECL_TEMPLATE_RESULT (tmpl); - - /* Make sure that we can see identifiers, and compute access - correctly. */ + /* Make sure that we can see identifiers, and compute access correctly. */ push_access_scope (decl); if (TREE_CODE (decl) == FUNCTION_DECL)