aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-10-31 13:37:13 -0400
committerJason Merrill <jason@redhat.com>2022-10-31 21:23:02 -0400
commit6a1f27f45e44bcfbcc06a1aad74bb076e56eda36 (patch)
treeb7b41c00189ba664002ac76b099f4fd0fc3d572f
parent1b9a5cc9ec08e9f239dd2096edcc447b7a72f64a (diff)
downloadgcc-6a1f27f45e44bcfbcc06a1aad74bb076e56eda36.zip
gcc-6a1f27f45e44bcfbcc06a1aad74bb076e56eda36.tar.gz
gcc-6a1f27f45e44bcfbcc06a1aad74bb076e56eda36.tar.bz2
c++: formatting tweaks
gcc/cp/ChangeLog: * decl.cc (duplicate_decls): Reformat loop. * parser.cc (cp_parser_member_declaration): Add newline. * semantics.cc: Remove newline.
-rw-r--r--gcc/cp/decl.cc9
-rw-r--r--gcc/cp/parser.cc1
-rw-r--r--gcc/cp/semantics.cc1
3 files changed, 4 insertions, 7 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index c7f1937..87cb7a6 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 9bdc609..6a5b065 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 36aa9c4..7c5f90b 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