aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cp/decl.c11
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea12e83..3ae9d55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2009-05-13 David Mandelin <dmandelin@mozilla.com>:
+
+ * decl.c (duplicate_decls): Preserve parameter attributes.
+
2009-05-14 Dave Korn <dave.korn.cygwin@gmail.com>
* config/i386/msformat-c.c (ms_printf_length_specs): Use enumeration
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fd944f7..dab3e5c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1913,6 +1913,17 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
{
tree parm;
+ /* Merge parameter attributes. */
+ tree oldarg, newarg;
+ for (oldarg = DECL_ARGUMENTS(olddecl),
+ newarg = DECL_ARGUMENTS(newdecl);
+ oldarg && newarg;
+ oldarg = TREE_CHAIN(oldarg), newarg = TREE_CHAIN(newarg)) {
+ DECL_ATTRIBUTES (newarg)
+ = (*targetm.merge_decl_attributes) (oldarg, newarg);
+ DECL_ATTRIBUTES (oldarg) = DECL_ATTRIBUTES (newarg);
+ }
+
if (DECL_TEMPLATE_INSTANTIATION (olddecl)
&& !DECL_TEMPLATE_INSTANTIATION (newdecl))
{