diff options
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) |