Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision bbbc067e84adc59b31d39e97991980bf6379934a)
+++ src/Common/utility.h	(revision 8d25360e4dfa05035c94eaafd0980fce401b0be7)
@@ -94,9 +94,9 @@
 template< typename SrcContainer, typename DestContainer >
 void cloneAll( const SrcContainer &src, DestContainer &dest ) {
-	typename SrcContainer::const_iterator in = src.begin();
-	std::back_insert_iterator< DestContainer > out( dest );
-	while ( in != src.end() ) {
-		*out++ = (*in++)->clone();
-	} // while
+	std::transform(src.begin(), src.end(), std::back_insert_iterator< DestContainer >( dest ),
+		[](const typename SrcContainer::value_type & t) -> typename DestContainer::value_type {
+			return t->clone();
+		}
+	);
 }
 
@@ -464,11 +464,11 @@
 
 // -----------------------------------------------------------------------------
-/// Reorders the input range in-place so that the minimal-value elements according to the 
-/// comparator are in front; 
+/// Reorders the input range in-place so that the minimal-value elements according to the
+/// comparator are in front;
 /// returns the iterator after the last minimal-value element.
 template<typename Iter, typename Compare>
 Iter sort_mins( Iter begin, Iter end, Compare& lt ) {
 	if ( begin == end ) return end;
-	
+
 	Iter min_pos = begin;
 	for ( Iter i = begin + 1; i != end; ++i ) {
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision bbbc067e84adc59b31d39e97991980bf6379934a)
+++ src/Parser/TypeData.cc	(revision 8d25360e4dfa05035c94eaafd0980fce401b0be7)
@@ -887,5 +887,5 @@
 
 
-NamedTypeDecl * buildSymbolic( const TypeData * td, std::vector< Attribute * > attributes, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) {
+NamedTypeDecl * buildSymbolic( const TypeData * td, const std::vector< Attribute * > & attributes, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) {
 	assert( td->kind == TypeData::Symbolic );
 	NamedTypeDecl * ret;
@@ -947,5 +947,5 @@
 
 
-Declaration * buildDecl( const TypeData * td, const string &name, Type::StorageClasses scs, Expression * bitfieldWidth, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec linkage, Expression *asmName, Initializer * init, std::vector< Attribute * > attributes ) {
+Declaration * buildDecl( const TypeData * td, const string &name, Type::StorageClasses scs, Expression * bitfieldWidth, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec linkage, Expression *asmName, Initializer * init, const std::vector< Attribute * > & attributes ) {
 	if ( td->kind == TypeData::Function ) {
 		if ( td->function.idList ) {					// KR function ?
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision bbbc067e84adc59b31d39e97991980bf6379934a)
+++ src/Parser/TypeData.h	(revision 8d25360e4dfa05035c94eaafd0980fce401b0be7)
@@ -130,5 +130,5 @@
 TypeofType * buildTypeof( const TypeData * );
 Declaration * buildDecl( const TypeData *, const std::string &, Type::StorageClasses, Expression *, Type::FuncSpecifiers funcSpec, LinkageSpec::Spec, Expression * asmName,
-						 Initializer * init = nullptr, std::vector< Attribute * > attributes = std::vector< Attribute * >() );
+						 Initializer * init = nullptr, const std::vector< Attribute * > & attributes = std::vector< Attribute * >() );
 FunctionType * buildFunction( const TypeData * );
 void buildKRFunction( const TypeData::Function_t & function );
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision bbbc067e84adc59b31d39e97991980bf6379934a)
+++ src/SymTab/Validate.cc	(revision 8d25360e4dfa05035c94eaafd0980fce401b0be7)
@@ -913,4 +913,5 @@
 			if ( ! inFunctionType ) {
 				ret->attributes.insert( ret->attributes.end(), typeInst->attributes.begin(), typeInst->attributes.end() );
+				typeInst->attributes.clear();
 			} else {
 				deleteAll( ret->attributes );
