Index: src/Validate/ReplaceTypedef.cpp
===================================================================
--- src/Validate/ReplaceTypedef.cpp	(revision 1931bb01089a99a839382b07c869b845128790a0)
+++ src/Validate/ReplaceTypedef.cpp	(revision af75a874034d5595d53a615e8e529fa039610605)
@@ -10,6 +10,6 @@
 // Created On       : Tue Jun 29 14:59:00 2022
 // Last Modified By : Andrew Beach
-// Last Modified On : Mon Jul 12 14:17:00 2022
-// Update Count     : 0
+// Last Modified On : Wed Jul 13 14:45:00 2022
+// Update Count     : 1
 //
 
@@ -63,6 +63,4 @@
 	void previsit( ast::TraitDecl const * );
 
-	void previsit( ast::FunctionType const * );
-
 	template<typename AggrDecl>
 	void addImplicitTypedef( AggrDecl * aggDecl );
@@ -78,5 +76,5 @@
 	CodeLocation const * nearestLocation = nullptr;
 	int scopeLevel;
-	bool inFunctionType = false;
+	bool isAtFunctionTop = false;
 };
 
@@ -105,9 +103,7 @@
 		ast::Type * ret = ast::deepCopy( def->second.first->base );
 		ret->qualifiers |= type->qualifiers;
-		// GCC ignores certain attributes if they arrive by typedef,
-		// this mimics that.
-		// TODO: This might cover too much, it should just cover arguments
-		//   and return values of a function.
-		if ( visitor->isInFunction() ) {
+		// We ignore certain attributes on function parameters if they arrive
+		// by typedef. GCC appears to do the same thing.
+		if ( isAtFunctionTop ) {
 			erase_if( ret->attributes, isNonParameterAttribute );
 		}
@@ -207,4 +203,5 @@
 	GuardScope( typedefNames );
 	GuardScope( typedeclNames );
+	GuardValue( isAtFunctionTop ) = true;
 }
 
@@ -262,4 +259,5 @@
 	GuardScope( typedefNames );
 	GuardScope( typedeclNames );
+	GuardValue( isAtFunctionTop ) = false;
 	scopeLevel += 1;
 }
@@ -292,8 +290,4 @@
 	GuardScope( typedefNames );
 	GuardScope( typedeclNames );
-}
-
-void ReplaceTypedefCore::previsit( ast::FunctionType const * ) {
-	GuardValue( inFunctionType ) = true;
 }
 
