Index: src/SynTree/FunctionDecl.cc
===================================================================
--- src/SynTree/FunctionDecl.cc	(revision c3b379965fbf50fe5a18bd22b16cf1e9fae2b3c4)
+++ src/SynTree/FunctionDecl.cc	(revision 97dbc0946e8dea780e194dc0cf12e9f89426fded)
@@ -26,4 +26,5 @@
 #include "Statement.h"           // for CompoundStmt
 #include "Type.h"                // for Type, FunctionType, Type::FuncSpecif...
+#include "VarExprReplacer.h"
 
 extern bool translation_unit_nomain;
@@ -39,4 +40,16 @@
 FunctionDecl::FunctionDecl( const FunctionDecl &other )
 		: Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
+
+	VarExprReplacer::DeclMap declMap;
+	for ( auto p : group_iterate( other.type->parameters, type->parameters ) ) {
+		declMap[ std::get<0>(p) ] = std::get<1>(p);
+	}
+	for ( auto p : group_iterate( other.type->returnVals, type->returnVals ) ) {
+		declMap[ std::get<0>(p) ] = std::get<1>(p);
+	}
+	if ( ! declMap.empty() ) {
+		VarExprReplacer replacer( declMap );
+		accept( replacer );
+	}
 }
 
