Index: src/SynTree/AggregateDecl.cc
===================================================================
--- src/SynTree/AggregateDecl.cc	(revision 2dc662154d08595feb19be7117ce6c3a4790139c)
+++ src/SynTree/AggregateDecl.cc	(revision 1997b4e812dbb8458b745e5395a203821f48882c)
@@ -86,19 +86,4 @@
 std::string TraitDecl::typeString() const { return "trait"; }
 
-namespace {
-	long long int getConstValue( Expression * expr ) {
-		if ( CastExpr * castExpr = dynamic_cast< CastExpr * > ( expr ) ) {
-			return getConstValue( castExpr->arg );
-		} else if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-			return constExpr->intValue();
-		// can be -1, +1, etc.
-		// } else if ( UntypedExpr * untypedExpr = dynamic_cast< UntypedExpr * >( expr ) ) {
-		// 	if ( untypedExpr-> )
-		} else {
-			assertf( false, "Unhandled expression type in getConstValue for enumerators: %s", toString( expr ).c_str() );
-		}
-	}
-}
-
 bool EnumDecl::valueOf( Declaration * enumerator, long long int & value ) {
 	if ( enumValues.empty() ) {
@@ -108,5 +93,7 @@
 			if ( field->init ) {
 				SingleInit * init = strict_dynamic_cast< SingleInit * >( field->init );
-				currentValue = getConstValue( init->value );
+				auto result = eval( init->value );
+				if ( ! result.second ) SemanticError( init->location, toString( "Non-constexpr in initialization of enumerator: ", field ) );
+				currentValue = result.first;
 			}
 			assertf( enumValues.count( field->name ) == 0, "Enum %s has multiple members with the name %s", name.c_str(), field->name.c_str() );
