Index: src/ResolvExpr/ResolveTypeof.cc
===================================================================
--- src/ResolvExpr/ResolveTypeof.cc	(revision f441c882023a95e64ef87d0bf8675cb0a49fbc9b)
+++ src/ResolvExpr/ResolveTypeof.cc	(revision 5e49e477912c55f01edbd8c838b63e99a80722bd)
@@ -91,4 +91,12 @@
 		// clear qualifiers for base, combine with typeoftype quals in any case
 		if ( isBasetypeof ) {
+			// replace basetypeof(<enum>) by int
+			if ( dynamic_cast<EnumInstType*>(newType) ) {
+				Type* newerType = 
+					new BasicType{ newType->get_qualifiers(), BasicType::SignedInt, 
+					newType->attributes };
+				delete newType;
+				newType = newerType;
+			}
 			newType->get_qualifiers().val 
 				= ( newType->get_qualifiers().val & ~Type::Qualifiers::Mask ) | oldQuals;
