Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision e15853c01fea9920d1adec991c801c4361669db7)
+++ src/ResolvExpr/Resolver.cc	(revision 30e32b2b00dfeda222cacf523a031087c59f8fe0)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 12:17:01 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Feb 13 18:13:43 2019
-// Update Count     : 216
+// Last Modified On : Tue Feb 19 18:09:56 2019
+// Update Count     : 240
 //
 
@@ -53,7 +53,7 @@
 		}
 
-		void previsit( FunctionDecl *functionDecl );
-		void postvisit( FunctionDecl *functionDecl );
-		void previsit( ObjectDecl *objectDecll );
+		void previsit( FunctionDecl * functionDecl );
+		void postvisit( FunctionDecl * functionDecl );
+		void previsit( ObjectDecl * objectDecll );
 		void previsit( EnumDecl * enumDecl );
 		void previsit( StaticAssertDecl * assertDecl );
@@ -62,21 +62,21 @@
 		void previsit( PointerType * at );
 
-		void previsit( ExprStmt *exprStmt );
-		void previsit( AsmExpr *asmExpr );
-		void previsit( AsmStmt *asmStmt );
-		void previsit( IfStmt *ifStmt );
-		void previsit( WhileStmt *whileStmt );
-		void previsit( ForStmt *forStmt );
-		void previsit( SwitchStmt *switchStmt );
-		void previsit( CaseStmt *caseStmt );
-		void previsit( BranchStmt *branchStmt );
-		void previsit( ReturnStmt *returnStmt );
-		void previsit( ThrowStmt *throwStmt );
-		void previsit( CatchStmt *catchStmt );
+		void previsit( ExprStmt * exprStmt );
+		void previsit( AsmExpr * asmExpr );
+		void previsit( AsmStmt * asmStmt );
+		void previsit( IfStmt * ifStmt );
+		void previsit( WhileStmt * whileStmt );
+		void previsit( ForStmt * forStmt );
+		void previsit( SwitchStmt * switchStmt );
+		void previsit( CaseStmt * caseStmt );
+		void previsit( BranchStmt * branchStmt );
+		void previsit( ReturnStmt * returnStmt );
+		void previsit( ThrowStmt * throwStmt );
+		void previsit( CatchStmt * catchStmt );
 		void previsit( WaitForStmt * stmt );
 
-		void previsit( SingleInit *singleInit );
-		void previsit( ListInit *listInit );
-		void previsit( ConstructorInit *ctorInit );
+		void previsit( SingleInit * singleInit );
+		void previsit( ListInit * listInit );
+		void previsit( ConstructorInit * ctorInit );
 	  private:
 		typedef std::list< Initializer * >::iterator InitIterator;
@@ -104,5 +104,5 @@
 	}
 
-	void resolveDecl( Declaration * decl, const SymTab::Indexer &indexer ) {
+	void resolveDecl( Declaration * decl, const SymTab::Indexer & indexer ) {
 		PassVisitor<Resolver> resolver( indexer );
 		maybeAccept( decl, resolver );
@@ -148,5 +148,5 @@
 		};
 
-		void finishExpr( Expression *&expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) {
+		void finishExpr( Expression *& expr, const TypeEnvironment & env, TypeSubstitution * oldenv = nullptr ) {
 			expr->env = oldenv ? oldenv->clone() : new TypeSubstitution;
 			env.makeSubstitution( *expr->env );
@@ -279,22 +279,22 @@
 
 	// used in resolveTypeof
-	Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer ) {
+	Expression * resolveInVoidContext( Expression * expr, const SymTab::Indexer & indexer ) {
 		TypeEnvironment env;
 		return resolveInVoidContext( expr, indexer, env );
 	}
 
-	Expression * resolveInVoidContext( Expression *expr, const SymTab::Indexer &indexer, TypeEnvironment &env ) {
+	Expression * resolveInVoidContext( Expression * expr, const SymTab::Indexer & indexer, TypeEnvironment & env ) {
 		// it's a property of the language that a cast expression has either 1 or 0 interpretations; if it has 0
 		// interpretations, an exception has already been thrown.
 		assertf( expr, "expected a non-null expression." );
 
-		static CastExpr untyped( nullptr ); // cast to void
-		untyped.location = expr->location;
+		CastExpr * untyped = new CastExpr( expr ); // cast to void
+		untyped->location = expr->location;
 
 		// set up and resolve expression cast to void
-		untyped.arg = expr;
 		Alternative choice;
-		findUnfinishedKindExpression( &untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() );
+		findUnfinishedKindExpression( untyped, choice, indexer, "", standardAlternativeFilter, ResolvMode::withAdjustment() );
 		CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( choice.expr );
+		assert( castExpr );
 		env = std::move( choice.env );
 
@@ -304,9 +304,9 @@
 
 		// unlink the arg so that it isn't deleted twice at the end of the program
-		untyped.arg = nullptr;
+		untyped->arg = nullptr;
 		return ret;
 	}
 
-	void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ) {
+	void findVoidExpression( Expression *& untyped, const SymTab::Indexer & indexer ) {
 		resetTyVarRenaming();
 		TypeEnvironment env;
@@ -317,5 +317,5 @@
 	}
 
-	void findSingleExpression( Expression *&untyped, const SymTab::Indexer &indexer ) {
+	void findSingleExpression( Expression *& untyped, const SymTab::Indexer & indexer ) {
 		findKindExpression( untyped, indexer, "", standardAlternativeFilter );
 	}
@@ -336,5 +336,5 @@
 			if ( dynamic_cast< EnumInstType * >( type ) ) {
 				return true;
-			} else if ( BasicType *bt = dynamic_cast< BasicType * >( type ) ) {
+			} else if ( BasicType * bt = dynamic_cast< BasicType * >( type ) ) {
 				return bt->isInteger();
 			} else if ( dynamic_cast< ZeroType* >( type ) != nullptr || dynamic_cast< OneType* >( type ) != nullptr ) {
@@ -345,5 +345,5 @@
 		}
 
-		void findIntegralExpression( Expression *& untyped, const SymTab::Indexer &indexer ) {
+		void findIntegralExpression( Expression *& untyped, const SymTab::Indexer & indexer ) {
 			findKindExpression( untyped, indexer, "condition", isIntegralType );
 		}
@@ -401,5 +401,5 @@
 	}
 
-	void Resolver::previsit( ObjectDecl *objectDecl ) {
+	void Resolver::previsit( ObjectDecl * objectDecl ) {
 		// To handle initialization of routine pointers, e.g., int (*fp)(int) = foo(), means that 
 		// class-variable initContext is changed multiple time because the LHS is analysed twice. 
@@ -431,5 +431,5 @@
 	}
 
-	void Resolver::previsit( FunctionDecl *functionDecl ) {
+	void Resolver::previsit( FunctionDecl * functionDecl ) {
 #if 0
 		std::cerr << "resolver visiting functiondecl ";
@@ -441,5 +441,5 @@
 	}
 
-	void Resolver::postvisit( FunctionDecl *functionDecl ) {
+	void Resolver::postvisit( FunctionDecl * functionDecl ) {
 		// default value expressions have an environment which shouldn't be there and trips up 
 		// later passes.
@@ -466,5 +466,5 @@
 	}
 
-	void Resolver::previsit( ExprStmt *exprStmt ) {
+	void Resolver::previsit( ExprStmt * exprStmt ) {
 		visit_children = false;
 		assertf( exprStmt->expr, "ExprStmt has null Expression in resolver" );
@@ -472,5 +472,5 @@
 	}
 
-	void Resolver::previsit( AsmExpr *asmExpr ) {
+	void Resolver::previsit( AsmExpr * asmExpr ) {
 		visit_children = false;
 		findVoidExpression( asmExpr->operand, indexer );
@@ -480,5 +480,5 @@
 	}
 
-	void Resolver::previsit( AsmStmt *asmStmt ) {
+	void Resolver::previsit( AsmStmt * asmStmt ) {
 		visit_children = false;
 		acceptAll( asmStmt->get_input(), *visitor );
@@ -486,13 +486,13 @@
 	}
 
-	void Resolver::previsit( IfStmt *ifStmt ) {
+	void Resolver::previsit( IfStmt * ifStmt ) {
 		findIntegralExpression( ifStmt->condition, indexer );
 	}
 
-	void Resolver::previsit( WhileStmt *whileStmt ) {
+	void Resolver::previsit( WhileStmt * whileStmt ) {
 		findIntegralExpression( whileStmt->condition, indexer );
 	}
 
-	void Resolver::previsit( ForStmt *forStmt ) {
+	void Resolver::previsit( ForStmt * forStmt ) {
 		if ( forStmt->condition ) {
 			findIntegralExpression( forStmt->condition, indexer );
@@ -504,5 +504,5 @@
 	}
 
-	void Resolver::previsit( SwitchStmt *switchStmt ) {
+	void Resolver::previsit( SwitchStmt * switchStmt ) {
 		GuardValue( currentObject );
 		findIntegralExpression( switchStmt->condition, indexer );
@@ -511,5 +511,5 @@
 	}
 
-	void Resolver::previsit( CaseStmt *caseStmt ) {
+	void Resolver::previsit( CaseStmt * caseStmt ) {
 		if ( caseStmt->condition ) {
 			std::list< InitAlternative > initAlts = currentObject.getOptions();
@@ -530,5 +530,5 @@
 	}
 
-	void Resolver::previsit( BranchStmt *branchStmt ) {
+	void Resolver::previsit( BranchStmt * branchStmt ) {
 		visit_children = false;
 		// must resolve the argument for a computed goto
@@ -541,5 +541,5 @@
 	}
 
-	void Resolver::previsit( ReturnStmt *returnStmt ) {
+	void Resolver::previsit( ReturnStmt * returnStmt ) {
 		visit_children = false;
 		if ( returnStmt->expr ) {
@@ -548,5 +548,5 @@
 	}
 
-	void Resolver::previsit( ThrowStmt *throwStmt ) {
+	void Resolver::previsit( ThrowStmt * throwStmt ) {
 		visit_children = false;
 		// TODO: Replace *exception type with &exception type.
@@ -560,5 +560,5 @@
 	}
 
-	void Resolver::previsit( CatchStmt *catchStmt ) {
+	void Resolver::previsit( CatchStmt * catchStmt ) {
 		if ( catchStmt->cond ) {
 			findSingleExpression( catchStmt->cond, new BasicType( noQualifiers, BasicType::Bool ), indexer );
@@ -724,10 +724,10 @@
 
 						}
-						catch( SemanticErrorException &e ) {
+						catch( SemanticErrorException & e ) {
 							errors.append( e );
 						}
 					}
 				}
-				catch( SemanticErrorException &e ) {
+				catch( SemanticErrorException & e ) {
 					errors.append( e );
 				}
@@ -781,5 +781,5 @@
 	}
 
-	void Resolver::previsit( SingleInit *singleInit ) {
+	void Resolver::previsit( SingleInit * singleInit ) {
 		visit_children = false;
 		// resolve initialization using the possibilities as determined by the currentObject cursor
@@ -813,5 +813,5 @@
 				if ( PointerType * pt = dynamic_cast< PointerType *>( newExpr->get_result() ) ) {
 					if ( isCharType( pt->get_base() ) ) {
-						if ( CastExpr *ce = dynamic_cast< CastExpr * >( newExpr ) ) {
+						if ( CastExpr * ce = dynamic_cast< CastExpr * >( newExpr ) ) {
 							// strip cast if we're initializing a char[] with a char *, 
 							// e.g.  char x[] = "hello";
@@ -893,5 +893,5 @@
 	}
 
-	void Resolver::previsit( ConstructorInit *ctorInit ) {
+	void Resolver::previsit( ConstructorInit * ctorInit ) {
 		visit_children = false;
 		// xxx - fallback init has been removed => remove fallbackInit function and remove complexity from FixInit and remove C-init from ConstructorInit
