Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision 7991c7dbb1962c1133182fc8f9dd01a39dc0bb72)
+++ src/ResolvExpr/CurrentObject.cc	(revision f37d9e7046a9c6349e0b0e9fbabf75209183a3ef)
@@ -9,7 +9,7 @@
 // Author           : Rob Schluntz
 // Created On       : Tue Jun 13 15:28:32 2017
-// Last Modified By : Rob Schluntz
-// Last Modified On : Tue Jun 13 15:28:44 2017
-// Update Count     : 2
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Jul  1 09:16:01 2022
+// Update Count     : 15
 //
 
@@ -158,6 +158,6 @@
 
 	private:
-		void setSize( Expression * expr ) { // replace this logic with an eval call
-			auto res = eval(expr);
+		void setSize( Expression * expr ) {
+			auto res = eval( expr );
 			if (res.second) {
 				size = res.first;
@@ -170,24 +170,28 @@
 		void setPosition( Expression * expr ) {
 			// need to permit integer-constant-expressions, including: integer constants, enumeration constants, character constants, sizeof expressions, _Alignof expressions, cast expressions
-			if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
-				try {
-					index = constExpr->intValue();
-				} catch( SemanticErrorException & ) {
-					SemanticError( expr, "Constant expression of non-integral type in array designator: " );
-				}
-			} else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
-				setPosition( castExpr->get_arg() );
-			} else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
-				EnumInstType * inst = dynamic_cast<EnumInstType *>( varExpr->get_result() );
-				assertf( inst, "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() );
-				long long int value;
-				if ( inst->baseEnum->valueOf( varExpr->var, value ) ) {
-					index = value;
-				}
-			} else if ( dynamic_cast< SizeofExpr * >( expr ) || dynamic_cast< AlignofExpr * >( expr ) ) {
-				index = 0; // xxx - get actual sizeof/alignof value?
-			} else {
-				assertf( false, "bad designator given to ArrayIterator: %s", toString( expr ).c_str() );
-			}
+			auto arg = eval( expr );
+			index = arg.first;
+			return;
+
+			// if ( ConstantExpr * constExpr = dynamic_cast< ConstantExpr * >( expr ) ) {
+			// 	try {
+			// 		index = constExpr->intValue();
+			// 	} catch( SemanticErrorException & ) {
+			// 		SemanticError( expr, "Constant expression of non-integral type in array designator: " );
+			// 	}
+			// } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
+			// 	setPosition( castExpr->get_arg() );
+			// } else if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
+			// 	EnumInstType * inst = dynamic_cast<EnumInstType *>( varExpr->get_result() );
+			// 	assertf( inst, "ArrayIterator given variable that isn't an enum constant : %s", toString( expr ).c_str() );
+			// 	long long int value;
+			// 	if ( inst->baseEnum->valueOf( varExpr->var, value ) ) {
+			// 		index = value;
+			// 	}
+			// } else if ( dynamic_cast< SizeofExpr * >( expr ) || dynamic_cast< AlignofExpr * >( expr ) ) {
+			// 	index = 0; // xxx - get actual sizeof/alignof value?
+			// } else {
+			// 	assertf( false, "4 bad designator given to ArrayIterator: %s", toString( expr ).c_str() );
+			// }
 		}
 
@@ -329,5 +333,5 @@
 					assertf( false, "could not find member in %s: %s", kind.c_str(), toString( varExpr ).c_str() );
 				} else {
-					assertf( false, "bad designator given to %s: %s", kind.c_str(), toString( designators.front() ).c_str() );
+					assertf( false, "3 bad designator given to %s: %s", kind.c_str(), toString( designators.front() ).c_str() );
 				} // if
 			} // if
@@ -637,8 +641,7 @@
 
 		void setSize( const Expr * expr ) {
-			auto res = eval(expr);
+			auto res = eval( expr );
 			if ( ! res.second ) {
-				SemanticError( location,
-					toString("Array designator must be a constant expression: ", expr ) );
+				SemanticError( location, toString( "Array designator must be a constant expression: ", expr ) );
 			}
 			size = res.first;
@@ -646,6 +649,5 @@
 
 	public:
-		ArrayIterator( const CodeLocation & loc, const ArrayType * at )
-		: location( loc ), array( at ), base( at->base ) {
+		ArrayIterator( const CodeLocation & loc, const ArrayType * at ) : location( loc ), array( at ), base( at->base ) {
 			PRINT( std::cerr << "Creating array iterator: " << at << std::endl; )
 			memberIter.reset( createMemberIterator( loc, base ) );
@@ -660,22 +662,22 @@
 			// enumeration constants, character constants, sizeof expressions, alignof expressions,
 			// cast expressions
-			if ( auto constExpr = dynamic_cast< const ConstantExpr * >( expr ) ) {
-				try {
-					index = constExpr->intValue();
-				} catch ( SemanticErrorException & ) {
-					SemanticError( expr,
-						"Constant expression of non-integral type in array designator: " );
-				}
-			} else if ( auto castExpr = dynamic_cast< const CastExpr * >( expr ) ) {
-				setPosition( castExpr->arg );
-			} else if (
-				dynamic_cast< const SizeofExpr * >( expr )
-				|| dynamic_cast< const AlignofExpr * >( expr )
-			) {
-				index = 0;
-			} else {
-				assertf( false,
-					"bad designator given to ArrayIterator: %s", toString( expr ).c_str() );
-			}
+
+			auto arg = eval( expr );
+			index = arg.first;
+			return;
+
+			// if ( auto constExpr = dynamic_cast< const ConstantExpr * >( expr ) ) {
+			// 	try {
+			// 		index = constExpr->intValue();
+			// 	} catch ( SemanticErrorException & ) {
+			// 		SemanticError( expr, "Constant expression of non-integral type in array designator: " );
+			// 	}
+			// } else if ( auto castExpr = dynamic_cast< const CastExpr * >( expr ) ) {
+			// 	setPosition( castExpr->arg );
+			// } else if ( dynamic_cast< const SizeofExpr * >( expr ) || dynamic_cast< const AlignofExpr * >( expr ) ) {
+			// 	index = 0;
+			// } else {
+			// 	assertf( false,	"2 bad designator given to ArrayIterator: %s", toString( expr ).c_str() );
+			// }
 		}
 
@@ -723,6 +725,5 @@
 				std::deque< InitAlternative > ret = memberIter->first();
 				for ( InitAlternative & alt : ret ) {
-					alt.designation.get_and_mutate()->designators.emplace_front(
-						ConstantExpr::from_ulong( location, index ) );
+					alt.designation.get_and_mutate()->designators.emplace_front( ConstantExpr::from_ulong( location, index ) );
 				}
 				return ret;
@@ -788,9 +789,7 @@
 					return;
 				}
-				assertf( false,
-					"could not find member in %s: %s", kind.c_str(), toString( varExpr ).c_str() );
+				assertf( false, "could not find member in %s: %s", kind.c_str(), toString( varExpr ).c_str() );
 			} else {
-				assertf( false,
-					"bad designator given to %s: %s", kind.c_str(), toString( *begin ).c_str() );
+				assertf( false, "1 bad designator given to %s: %s", kind.c_str(), toString( *begin ).c_str() );
 			}
 		}
