Index: src/SymTab/Autogen.cc
===================================================================
--- src/SymTab/Autogen.cc	(revision a7c90d4d68e0538c8215b52b958e12c56980c401)
+++ src/SymTab/Autogen.cc	(revision 861799c7471bc5f428e98ee82e5cc722ab2ffda7)
@@ -151,5 +151,5 @@
 	bool hasDynamicLayout( AggrDecl * aggregateDecl ) {
 		for ( TypeDecl * param : aggregateDecl->get_parameters() ) {
-			if ( param->get_kind() == TypeDecl::Any ) return true;
+			if ( param->isComplete() ) return true;
 		}
 		return false;
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision a7c90d4d68e0538c8215b52b958e12c56980c401)
+++ src/SymTab/Validate.cc	(revision 861799c7471bc5f428e98ee82e5cc722ab2ffda7)
@@ -224,7 +224,7 @@
 		HoistStruct::hoistStruct( translationUnit );
 		ReturnTypeFixer::fix( translationUnit ); // must happen before autogen
+		acceptAll( translationUnit, lrt ); // must happen before autogen, because sized flag needs to propagate to generated functions
 		autogenerateRoutines( translationUnit ); // moved up, used to be below compoundLiteral - currently needs EnumAndPointerDecayPass
 		acceptAll( translationUnit, epc );
-		acceptAll( translationUnit, lrt );
 		ReturnChecker::checkFunctionReturns( translationUnit );
 		compoundliteral.mutateDeclarationList( translationUnit );
@@ -838,6 +838,6 @@
 		assertf( retVals.size() == 0 || retVals.size() == 1, "Function %s has too many return values: %d", functionDecl->get_name().c_str(), retVals.size() );
 		if ( retVals.size() == 1 ) {
-			// ensure all function return values have a name - use the name of the function to disambiguate (this also provides a nice bit of help for debugging)
-			// ensure other return values have a name
+			// ensure all function return values have a name - use the name of the function to disambiguate (this also provides a nice bit of help for debugging).
+			// ensure other return values have a name.
 			DeclarationWithType * ret = retVals.front();
 			if ( ret->get_name() == "" ) {
