diff options
author | Nathan Sidwell <nathan@acm.org> | 2019-04-29 15:22:41 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2019-04-29 15:22:41 +0000 |
commit | 348dd384c8f647ba56be21932d068d180be243e3 (patch) | |
tree | d90b262f2e2e18807b5a05fa37174d4ad1ceb35b /gcc/cp/decl.c | |
parent | 074084767c9d7c4d52d919c343b65bb61c564096 (diff) | |
download | gcc-348dd384c8f647ba56be21932d068d180be243e3.zip gcc-348dd384c8f647ba56be21932d068d180be243e3.tar.gz gcc-348dd384c8f647ba56be21932d068d180be243e3.tar.bz2 |
[C++ PATCH] some cleanups
https://gcc.gnu.org/ml/gcc-patches/2019-04/msg01174.html
* decl.c (duplicate_decls): Add whitespace, move comments into
conditional blocks.
* method.c (explain_implicit_non_constexpr): Refactor.
* pt.c (check_explicit_specialization): Fix indentation.
* semantics.c (process_outer_var_ref): Reformat.
(finish_id_expression_1): Use STRIP_TEMPLATE.
From-SVN: r270655
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 20a6e2e..5c4a38e 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1,4 +1,4 @@ -/* Process declarations and variables for C++ compiler. +/* Process declarations and variables for -*- C++ -*- compiler. Copyright (C) 1988-2019 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) @@ -1476,7 +1476,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) if (! same_type_p (TREE_VALUE (t1), TREE_VALUE (t2))) break; -next_arg:; + next_arg:; } warning_at (newdecl_loc, @@ -2386,9 +2386,10 @@ next_arg:; } DECL_TEMPLATE_INFO (newdecl) = DECL_TEMPLATE_INFO (olddecl); } - /* Only functions have these fields. */ + if (DECL_DECLARES_FUNCTION_P (newdecl)) { + /* Only functions have these fields. */ DECL_NONCONVERTING_P (newdecl) = DECL_NONCONVERTING_P (olddecl); DECL_BEFRIENDING_CLASSES (newdecl) = chainon (DECL_BEFRIENDING_CLASSES (newdecl), @@ -2398,10 +2399,12 @@ next_arg:; if (DECL_VIRTUAL_P (newdecl)) SET_DECL_THUNKS (newdecl, DECL_THUNKS (olddecl)); } - /* Only variables have this field. */ - else if (VAR_P (newdecl) - && VAR_HAD_UNKNOWN_BOUND (olddecl)) - SET_VAR_HAD_UNKNOWN_BOUND (newdecl); + else if (VAR_P (newdecl)) + { + /* Only variables have this field. */ + if (VAR_HAD_UNKNOWN_BOUND (olddecl)) + SET_VAR_HAD_UNKNOWN_BOUND (newdecl); + } } if (TREE_CODE (newdecl) == FUNCTION_DECL) |