@@ -869,7 +869,7 @@ 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), NULL_TREE);
+ list = tree_cons (TREE_PURPOSE (p), TREE_VALUE (p), list);
DECL_ATTRIBUTES (fndecl) = nreverse (list);
}
@@ -11561,7 +11561,7 @@ tsubst_contract (tree decl, tree t, tree args, tsubst_flags_t complain,
tree r = copy_node (t);
/* Rebuild the result variable. */
- if (POSTCONDITION_P (t) && POSTCONDITION_IDENTIFIER (t))
+ if (type && POSTCONDITION_P (t) && POSTCONDITION_IDENTIFIER (t))
{
tree oldvar = POSTCONDITION_IDENTIFIER (t);