Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 92538ab6b62a97cccbb9045dcd6004887dec9529)
+++ src/SymTab/Validate.cc	(revision 9e7236f4ea98982d55cddf21f808b612dbfe6ddf)
@@ -760,5 +760,4 @@
 		} // if
 	}
-
 	void LinkReferenceToTypes_old::postvisit( StructInstType * structInst ) {
 		const StructDecl * st = local_indexer->lookupStruct( structInst->name );
@@ -886,4 +885,12 @@
 	void LinkReferenceToTypes_old::postvisit( EnumDecl * enumDecl ) {
 		// visit enum members first so that the types of self-referencing members are updated properly
+		// Replace the enum base; right now it works only for StructEnum
+		if ( enumDecl->base && dynamic_cast<TypeInstType*>(enumDecl->base) ) {
+			std::string baseName = static_cast<TypeInstType*>(enumDecl->base)->name;
+			const StructDecl * st = local_indexer->lookupStruct( baseName );
+			if ( st ) {
+				enumDecl->base = new StructInstType(Type::Qualifiers(),const_cast<StructDecl *>(st)); // Just linking in the node
+			}
+		}
 		if ( enumDecl->body ) {
 			ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl->name );
