Index: src/ResolvExpr/Resolver.cpp
===================================================================
--- src/ResolvExpr/Resolver.cpp	(revision 0c327cee778443a440104253db33557cee4d2a92)
+++ src/ResolvExpr/Resolver.cpp	(revision a1a1f37d7d17459fbc460ce2bf20161d668d4835)
@@ -322,7 +322,7 @@
 
 namespace {
-	bool structOrUnion( const Candidate & i ) {
+	bool structOrUnionOrEnum( const Candidate & i ) {
 		const ast::Type * t = i.expr->result->stripReferences();
-		return dynamic_cast< const ast::StructInstType * >( t ) || dynamic_cast< const ast::UnionInstType * >( t );
+		return dynamic_cast< const ast::StructInstType * >( t ) || dynamic_cast< const ast::UnionInstType * >( t ) || dynamic_cast< const ast::EnumInstType * >( t );
 	}
 	/// Predicate for "Candidate has integral type"
@@ -1140,5 +1140,5 @@
 	for (auto & expr : exprs) {
 		// only struct- and union-typed expressions are viable candidates
-		expr = findKindExpression( expr, context, structOrUnion, "with expression" );
+		expr = findKindExpression( expr, context, structOrUnionOrEnum, "with expression" );
 
 		// if with expression might be impure, create a temporary so that it is evaluated once
