Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision 64071c2ad8eac1915b692988a8dc0d8e9d7cb8da)
+++ src/ResolvExpr/CommonType.cc	(revision a43694718462ba1b32dfae2db7da760ceb7c581a)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// CommonType.cc -- 
+// CommonType.cc --
 //
 // Author           : Richard C. Bilson
@@ -134,4 +134,10 @@
 				result = new BasicType( basicType->get_qualifiers() + otherBasic->get_qualifiers(), newType );
 			} // if
+		} else if ( EnumInstType *enumInstType = dynamic_cast< EnumInstType * > ( type2 ) ) {
+			// use signed int in lieu of the enum type
+			BasicType::Kind newType = combinedType[ basicType->get_kind() ][ BasicType::SignedInt ];
+			if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= enumInstType->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= enumInstType->get_qualifiers() ) || widenSecond ) ) {
+				result = new BasicType( basicType->get_qualifiers() + enumInstType->get_qualifiers(), newType );
+			} // if
 		} // if
 	}
@@ -183,5 +189,12 @@
 	}
 
-	void CommonType::visit( EnumInstType *aggregateUseType ) {
+	void CommonType::visit( EnumInstType *enumInstType ) {
+		if ( dynamic_cast< BasicType * >( type2 ) ) {
+			// reuse BasicType, EnumInstType code by swapping type2 with enumInstType
+			Type * temp = type2;
+			type2 = enumInstType;
+			temp->accept( *this );
+			type2 = temp;
+		} // if
 	}
 
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 64071c2ad8eac1915b692988a8dc0d8e9d7cb8da)
+++ src/ResolvExpr/ConversionCost.cc	(revision a43694718462ba1b32dfae2db7da760ceb7c581a)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// ConversionCost.cc -- 
+// ConversionCost.cc --
 //
 // Author           : Richard C. Bilson
@@ -157,5 +157,8 @@
 				cost = Cost( 0, 0, tableResult );
 			} // if
-		} // if
+		} else if ( dynamic_cast< EnumInstType *>( dest ) ) {
+			// xxx - not positive this is correct, but appears to allow casting int => enum
+			cost = Cost( 1, 0, 0 );
+    } // if
 	}
 
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 64071c2ad8eac1915b692988a8dc0d8e9d7cb8da)
+++ src/ResolvExpr/Resolver.cc	(revision a43694718462ba1b32dfae2db7da760ceb7c581a)
@@ -38,4 +38,5 @@
 		virtual void visit( ObjectDecl *functionDecl );
 		virtual void visit( TypeDecl *typeDecl );
+		virtual void visit( EnumDecl * enumDecl );
 
 		virtual void visit( ArrayType * at );
@@ -66,4 +67,5 @@
 		Type *initContext;
 		Type *switchType;
+		bool inEnumDecl = false;
 	};
 
@@ -178,5 +180,14 @@
 		Type *temp = initContext;
 		initContext = new_type;
+		if ( inEnumDecl && dynamic_cast< EnumInstType * >( initContext ) ) {
+			// enumerator initializers should not use the enum type to initialize, since
+			// the enum type is still incomplete at this point. Use signed int instead.
+			initContext = new BasicType( Type::Qualifiers(), BasicType::SignedInt );
+		}
 		SymTab::Indexer::visit( objectDecl );
+		if ( inEnumDecl && dynamic_cast< EnumInstType * >( initContext ) ) {
+			// delete newly created signed int type
+			delete initContext;
+		}
 		initContext = temp;
 	}
@@ -216,4 +227,12 @@
 		SymTab::Indexer::visit( functionDecl );
 		functionReturn = oldFunctionReturn;
+	}
+
+	void Resolver::visit( EnumDecl * enumDecl ) {
+		// in case we decide to allow nested enums
+		bool oldInEnumDecl = inEnumDecl;
+		inEnumDecl = true;
+		SymTab::Indexer::visit( enumDecl );
+		inEnumDecl = oldInEnumDecl;
 	}
 
