Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 3da470c57355e51b60b8f2950f55c97d7c092255)
+++ src/SymTab/Validate.cc	(revision 45161b4dbe96eb7c39820eada44ba63904bc88cc)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 21:50:04 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Apr  7 16:45:30 2016
-// Update Count     : 243
+// Last Modified On : Wed Apr 13 16:39:30 2016
+// Update Count     : 251
 //
 
@@ -190,4 +190,7 @@
 		AggDecl *handleAggregate( AggDecl * aggDecl );
 
+		template<typename AggDecl>
+		void addImplicitTypedef( AggDecl * aggDecl );
+		
 		typedef std::map< std::string, std::pair< TypedefDecl *, int > > TypedefMap;
 		TypedefMap typedefNames;
@@ -1014,7 +1017,6 @@
 	}
 
-	// there may be typedefs nested within aggregates
-	// in order for everything to work properly, these
-	// should be removed as well
+	// there may be typedefs nested within aggregates in order for everything to work properly, these should be removed
+	// as well
 	template<typename AggDecl>
 	AggDecl *EliminateTypedef::handleAggregate( AggDecl * aggDecl ) {
@@ -1030,6 +1032,22 @@
 		return aggDecl;
 	}
-
+	
+	template<typename AggDecl>
+	void EliminateTypedef::addImplicitTypedef( AggDecl * aggDecl ) {
+		if ( typedefNames.count( aggDecl->get_name() ) == 0 ) {
+			Type *type;
+			if ( StructDecl * newDeclStructDecl = dynamic_cast< StructDecl * >( aggDecl ) ) {
+				type = new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() );
+			} else if ( UnionDecl * newDeclUnionDecl = dynamic_cast< UnionDecl * >( aggDecl ) ) {
+				type = new UnionInstType( Type::Qualifiers(), newDeclUnionDecl->get_name() );
+			} else if ( EnumDecl * newDeclEnumDecl = dynamic_cast< EnumDecl * >( aggDecl )  ) {
+				type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() );
+			} // if
+			TypedefDecl * tyDecl = new TypedefDecl( aggDecl->get_name(), DeclarationNode::NoStorageClass, type );
+			typedefNames[ aggDecl->get_name() ] = std::make_pair( tyDecl, scopeLevel );
+		} // if
+	}
 	Declaration *EliminateTypedef::mutate( StructDecl * structDecl ) {
+		addImplicitTypedef( structDecl );
 		Mutator::mutate( structDecl );
 		return handleAggregate( structDecl );
@@ -1037,4 +1055,5 @@
 
 	Declaration *EliminateTypedef::mutate( UnionDecl * unionDecl ) {
+		addImplicitTypedef( unionDecl );
 		Mutator::mutate( unionDecl );
 		return handleAggregate( unionDecl );
@@ -1042,9 +1061,10 @@
 
 	Declaration *EliminateTypedef::mutate( EnumDecl * enumDecl ) {
+		addImplicitTypedef( enumDecl );
 		Mutator::mutate( enumDecl );
 		return handleAggregate( enumDecl );
 	}
 
-		Declaration *EliminateTypedef::mutate( TraitDecl * contextDecl ) {
+	Declaration *EliminateTypedef::mutate( TraitDecl * contextDecl ) {
 		Mutator::mutate( contextDecl );
 		return handleAggregate( contextDecl );
