Index: src/AST/Attribute.cpp
===================================================================
--- src/AST/Attribute.cpp	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ src/AST/Attribute.cpp	(revision b262cb319ecbb4a4d3556a10cd2adc1ef8640982)
@@ -38,9 +38,10 @@
 
 bool Attribute::isValidOnFuncParam() const {
-	// attributes such as aligned, cleanup, etc. produce GCC errors when they appear
-	// on function parameters. Maintain here a whitelist of attribute names that are
-	// allowed to appear on parameters.
+	// Attributes produce GCC errors when they appear on function
+	// parameters. This is an allow-list, switching to a forbid-list would
+	// have to at least mention:
+	// aligned
 	std::string norm = normalizedName();
-	return norm == "unused" || norm == "noreturn";
+	return norm == "unused" || norm == "noreturn" || norm == "vector_size";
 }
 
Index: src/Validate/Autogen.cpp
===================================================================
--- src/Validate/Autogen.cpp	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ src/Validate/Autogen.cpp	(revision b262cb319ecbb4a4d3556a10cd2adc1ef8640982)
@@ -440,5 +440,7 @@
 
 		auto * paramType = ast::deepCopy( member->get_type() );
-		paramType->attributes.clear();
+		erase_if( paramType->attributes, []( ast::Attribute const * attr ){
+			return !attr->isValidOnFuncParam();
+		} );
 		ast::ObjectDecl * param = new ast::ObjectDecl(
 			getLocation(), member->name, paramType );
Index: src/Validate/ReplaceTypedef.cpp
===================================================================
--- src/Validate/ReplaceTypedef.cpp	(revision cfbc56ecba6583d7520c7a7a6bf7f4194e8016a0)
+++ src/Validate/ReplaceTypedef.cpp	(revision b262cb319ecbb4a4d3556a10cd2adc1ef8640982)
@@ -25,16 +25,4 @@
 
 namespace {
-
-bool isNonParameterAttribute( ast::Attribute const * attr ) {
-	static const std::vector<std::string> bad_names = {
-		"aligned", "__aligned__",
-	};
-	for ( auto name : bad_names ) {
-		if ( name == attr->name ) {
-			return true;
-		}
-	}
-	return false;
-}
 
 struct ReplaceTypedefCore final :
@@ -101,5 +89,7 @@
 		// by typedef. GCC appears to do the same thing.
 		if ( isAtFunctionTop ) {
-			erase_if( ret->attributes, isNonParameterAttribute );
+			erase_if( ret->attributes, []( ast::Attribute const * attr ){
+				return !attr->isValidOnFuncParam();
+			} );
 		}
 		for ( const auto & attribute : type->attributes ) {
