Index: src/Parser/DeclarationNode.hpp
===================================================================
--- src/Parser/DeclarationNode.hpp	(revision 725f777f7021ba28ca4e91128ba3bb63e7b14a46)
+++ src/Parser/DeclarationNode.hpp	(revision 9d5eacb77f6659b84df326bf35fe21bcde7e425b)
@@ -27,5 +27,5 @@
 	static DeclarationNode * newFunction( const std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body );
 	static DeclarationNode * newAggregate( ast::AggregateDecl::Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body );
-	static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body, bool typed, DeclarationNode * base = nullptr, EnumHiding hiding = EnumHiding::Visible );
+	static DeclarationNode * newEnum( const std::string * name, DeclarationNode * constants, bool body, bool isCfa = false, DeclarationNode * base = nullptr, EnumHiding hiding = EnumHiding::Visible );
 	static DeclarationNode * newEnumConstant( const std::string * name, ExpressionNode * constant );
 	static DeclarationNode * newEnumValueGeneric( const std::string * name, InitializerNode * init );
Index: src/ResolvExpr/ResolveTypeof.cpp
===================================================================
--- src/ResolvExpr/ResolveTypeof.cpp	(revision 725f777f7021ba28ca4e91128ba3bb63e7b14a46)
+++ src/ResolvExpr/ResolveTypeof.cpp	(revision 9d5eacb77f6659b84df326bf35fe21bcde7e425b)
@@ -61,8 +61,9 @@
 		if ( typeofType->kind == ast::TypeofType::Basetypeof ) {
 			// replace basetypeof(<enum>) by int
-			// if ( newType.as< ast::EnumInstType >() ) {
-			// 	newType = new ast::BasicType(
-			// 		ast::BasicKind::SignedInt, newType->qualifiers, copy(newType->attributes) );
-			// }
+			auto enumInst = newType.as< ast::EnumInstType >();
+			if ( enumInst && (!enumInst->base || !enumInst->base->isCfa) ) {
+				newType = new ast::BasicType(
+					ast::BasicKind::SignedInt, newType->qualifiers, copy(newType->attributes) );
+			}
 			reset_qualifiers(
 				newType,
Index: src/Validate/Autogen.cpp
===================================================================
--- src/Validate/Autogen.cpp	(revision 725f777f7021ba28ca4e91128ba3bb63e7b14a46)
+++ src/Validate/Autogen.cpp	(revision 9d5eacb77f6659b84df326bf35fe21bcde7e425b)
@@ -245,6 +245,8 @@
 	ast::EnumInstType enumInst( enumDecl->name );
 	enumInst.base = enumDecl;
-	EnumFuncGenerator gen( enumDecl, &enumInst, functionNesting );
-	gen.generateAndPrependDecls( declsToAddBefore );
+	if ( enumDecl->isCfa ) {
+		EnumFuncGenerator gen( enumDecl, &enumInst, functionNesting );
+		gen.generateAndPrependDecls( declsToAddBefore );
+	}
 
 	EnumFuncGenerator gen2( enumDecl, &enumInst, functionNesting );
@@ -742,5 +744,5 @@
 	for ( auto & generator : standardProtos ) {
 		ast::FunctionDecl * decl = (this->*generator)();
-		// produceForwardDecl( decl ); Done in genForwards
+		produceForwardDecl( decl );
 		genFuncBody( decl );
 		if ( CodeGen::isAssignment( decl->name ) ) {
Index: src/Validate/ImplementEnumFunc.cpp
===================================================================
--- src/Validate/ImplementEnumFunc.cpp	(revision 725f777f7021ba28ca4e91128ba3bb63e7b14a46)
+++ src/Validate/ImplementEnumFunc.cpp	(revision 9d5eacb77f6659b84df326bf35fe21bcde7e425b)
@@ -105,27 +105,20 @@
 		assert(memAsObjectDecl);
 		if (auto& init = memAsObjectDecl->init) {
-			auto singleInit = init.strict_as<ast::SingleInit>();
-			auto nameExpr = singleInit->value.as<ast::NameExpr>();
-			if (nameExpr) {
-				auto name = nameExpr->name;
-				if (auto it = std::find_if(decl->members.begin(), decl->members.end(), 
-					[name](ast::ptr<ast::Decl> mem_decl) {
-						return (mem_decl->name == name);
-					}); it != std::end(decl->members)
-				) {
-					// ast::SingleInit* newInit = new ast::SingleInit(
-					// 	init->location, new ast::CastExpr( nameExpr->location, 
-					// 	nameExpr, new ast::BasicType( ast::BasicKind::UnsignedInt ), ast::ExplicitCast )
-					// );
-					// auto targetInit = (*it).strict_as<ast::ObjectDecl>()->init;
-					// inits.emplace_back( targetInit );
-					auto index = std::distance( decl->members.begin(), it );
-					auto targetInit = inits.at(index).strict_as<ast::SingleInit>();
-					auto targetExpr = targetInit->value;
-					inits.push_back( new ast::SingleInit( targetExpr->location, targetExpr ) );
-					continue;
+			if ( auto singleInit = init.as<ast::SingleInit>() ) {
+				if ( auto nameExpr = singleInit->value.as<ast::NameExpr>() ) {
+					auto name = nameExpr->name;
+					if (auto it = std::find_if(decl->members.begin(), decl->members.end(),
+						[name](ast::ptr<ast::Decl> mem_decl) {
+							return (mem_decl->name == name);
+						}); it != std::end(decl->members)
+					) {
+						auto index = std::distance( decl->members.begin(), it );
+						auto targetInit = inits.at(index).strict_as<ast::SingleInit>();
+						auto targetExpr = targetInit->value;
+						inits.push_back( new ast::SingleInit( targetExpr->location, targetExpr ) );
+						continue;
+					}
 				}
 			}
-
 			inits.emplace_back(memAsObjectDecl->init);
 		} else {
