aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/contracts.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/contracts.cc')
-rw-r--r--gcc/cp/contracts.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
index f2b126c..3ca2102 100644
--- a/gcc/cp/contracts.cc
+++ b/gcc/cp/contracts.cc
@@ -863,7 +863,11 @@ remove_contract_attributes (tree fndecl)
tree list = NULL_TREE;
for (tree p = DECL_ATTRIBUTES (fndecl); p; p = TREE_CHAIN (p))
if (!cxx_contract_attribute_p (p))
- list = tree_cons (TREE_PURPOSE (p), TREE_VALUE (p), list);
+ {
+ tree nl = copy_node (p);
+ TREE_CHAIN (nl) = list;
+ list = nl;
+ }
DECL_ATTRIBUTES (fndecl) = nreverse (list);
}