From: Jason Merrill Date: Mon, 31 Oct 2022 17:37:13 +0000 (-0400) Subject: c++: formatting tweaks X-Git-Tag: basepoints/gcc-14~3624 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a1f27f45e44bcfbcc06a1aad74bb076e56eda36;p=thirdparty%2Fgcc.git c++: formatting tweaks gcc/cp/ChangeLog: * decl.cc (duplicate_decls): Reformat loop. * parser.cc (cp_parser_member_declaration): Add newline. * semantics.cc: Remove newline. --- diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index c7f1937ea48f..87cb7a6c3a41 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -2343,12 +2343,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden) DECL_INITIAL (old_result) = DECL_INITIAL (new_result); if (DECL_FUNCTION_TEMPLATE_P (newdecl)) { - tree parm; - DECL_ARGUMENTS (old_result) - = DECL_ARGUMENTS (new_result); - for (parm = DECL_ARGUMENTS (old_result); parm; - parm = DECL_CHAIN (parm)) - DECL_CONTEXT (parm) = old_result; + DECL_ARGUMENTS (old_result) = DECL_ARGUMENTS (new_result); + for (tree p = DECL_ARGUMENTS (old_result); p; p = DECL_CHAIN (p)) + DECL_CONTEXT (p) = old_result; if (tree fc = DECL_FRIEND_CONTEXT (new_result)) SET_DECL_FRIEND_CONTEXT (old_result, fc); diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 9bdc60949f40..6a5b0652a093 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -27522,6 +27522,7 @@ cp_parser_member_declaration (cp_parser* parser) decl = grokfield (declarator, &decl_specifiers, initializer, /*init_const_expr_p=*/true, asm_specification, attributes); + if (parser->fully_implicit_function_template_p) { if (friend_p) diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 36aa9c4499fa..7c5f90b51270 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -731,7 +731,6 @@ end_maybe_infinite_loop (tree cond) } } - /* Begin a conditional that might contain a declaration. When generating normal code, we want the declaration to appear before the statement containing the conditional. When generating template code, we want the