Index: src/ResolvExpr/ResolveTypeof.cc
===================================================================
--- src/ResolvExpr/ResolveTypeof.cc	(revision f441c882023a95e64ef87d0bf8675cb0a49fbc9b)
+++ src/ResolvExpr/ResolveTypeof.cc	(revision 8e047947cd4f0671f365d8a7f63521132e2e48e4)
@@ -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;
