Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision 7870799883ca946218c97fb6a189d1da90a16e8e)
+++ src/SymTab/Indexer.cc	(revision fce4e31b3ccbea074ba05609992ef025123ea16a)
@@ -74,7 +74,7 @@
 	}
 
-	Indexer::Indexer() 
-	: idTable(), typeTable(), structTable(), enumTable(), unionTable(), traitTable(), 
-	  prevScope(), scope( 0 ), repScope( 0 ) { ++*stats().count; }
+	Indexer::Indexer()
+	: idTable(), typeTable(), structTable(), enumTable(), unionTable(), traitTable(),
+	  prevScope(), scope( 0 ), repScope( 0 ) { ++* stats().count; }
 
 	Indexer::~Indexer() {
@@ -84,7 +84,7 @@
 	void Indexer::lazyInitScope() {
 		if ( repScope < scope ) {
-			++*stats().lazy_scopes;
+			++* stats().lazy_scopes;
 			// create rollback
-			prevScope = std::make_shared<Indexer>( *this );
+			prevScope = std::make_shared<Indexer>( * this );
 			// update repScope
 			repScope = scope;
@@ -95,5 +95,5 @@
 		++scope;
 
-		++*stats().new_scopes;
+		++* stats().new_scopes;
 		stats().avg_scope_depth->push( scope );
 		stats().max_scope_depth->push( scope );
@@ -103,5 +103,5 @@
 		if ( repScope == scope ) {
 			Ptr prev = prevScope;           // make sure prevScope stays live
-			*this = std::move(*prevScope);  // replace with previous scope
+			* this = std::move(* prevScope);  // replace with previous scope
 		}
 
@@ -109,9 +109,9 @@
 	}
 
-	void Indexer::lookupId( const std::string &id, std::list< IdData > &out ) const {
-		++*stats().lookup_calls;
+	void Indexer::lookupId( const std::string & id, std::list< IdData > &out ) const {
+		++* stats().lookup_calls;
 		if ( ! idTable ) return;
 
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto decls = idTable->find( id );
 		if ( decls == idTable->end() ) return;
@@ -122,48 +122,53 @@
 	}
 
-	NamedTypeDecl *Indexer::lookupType( const std::string &id ) const {
-		++*stats().lookup_calls;
+	const NamedTypeDecl * Indexer::lookupType( const std::string & id ) const { return lookupMutableType(id); }
+	NamedTypeDecl * Indexer::lookupMutableType( const std::string & id ) const {
+		++* stats().lookup_calls;
 		if ( ! typeTable ) return nullptr;
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto it = typeTable->find( id );
 		return it == typeTable->end() ? nullptr : it->second.decl;
 	}
 
-	StructDecl *Indexer::lookupStruct( const std::string &id ) const {
-		++*stats().lookup_calls;
+	const StructDecl * Indexer::lookupStruct( const std::string & id ) const { return lookupMutableStruct(id); }
+	StructDecl * Indexer::lookupMutableStruct( const std::string & id ) const {
+		++* stats().lookup_calls;
 		if ( ! structTable ) return nullptr;
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto it = structTable->find( id );
 		return it == structTable->end() ? nullptr : it->second.decl;
 	}
 
-	EnumDecl *Indexer::lookupEnum( const std::string &id ) const {
-		++*stats().lookup_calls;
+	const EnumDecl * Indexer::lookupEnum( const std::string & id ) const { return lookupMutableEnum(id); }
+	EnumDecl * Indexer::lookupMutableEnum( const std::string & id ) const {
+		++* stats().lookup_calls;
 		if ( ! enumTable ) return nullptr;
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto it = enumTable->find( id );
 		return it == enumTable->end() ? nullptr : it->second.decl;
 	}
 
-	UnionDecl *Indexer::lookupUnion( const std::string &id ) const {
-		++*stats().lookup_calls;
+	const UnionDecl * Indexer::lookupUnion( const std::string & id ) const { return lookupMutableUnion(id); }
+	UnionDecl * Indexer::lookupMutableUnion( const std::string & id ) const {
+		++* stats().lookup_calls;
 		if ( ! unionTable ) return nullptr;
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto it = unionTable->find( id );
 		return it == unionTable->end() ? nullptr : it->second.decl;
 	}
 
-	TraitDecl *Indexer::lookupTrait( const std::string &id ) const {
-		++*stats().lookup_calls;
+	const TraitDecl * Indexer::lookupTrait( const std::string & id ) const { return lookupMutableTrait(id); }
+	TraitDecl * Indexer::lookupMutableTrait( const std::string & id ) const {
+		++* stats().lookup_calls;
 		if ( ! traitTable ) return nullptr;
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto it = traitTable->find( id );
 		return it == traitTable->end() ? nullptr : it->second.decl;
 	}
 
-	const Indexer* Indexer::atScope( unsigned long target ) const {
+	const Indexer * Indexer::atScope( unsigned long target ) const {
 		// by lazy construction, final indexer in list has repScope 0, cannot be > target
 		// otherwise, will find first scope representing the target
-		const Indexer* indexer = this;
+		const Indexer * indexer = this;
 		while ( indexer->repScope > target ) {
 			indexer = indexer->prevScope.get();
@@ -172,17 +177,17 @@
 	}
 
-	NamedTypeDecl *Indexer::globalLookupType( const std::string &id ) const {
+	const NamedTypeDecl * Indexer::globalLookupType( const std::string & id ) const {
 		return atScope( 0 )->lookupType( id );
 	}
 
-	StructDecl *Indexer::globalLookupStruct( const std::string &id ) const {
+	const StructDecl * Indexer::globalLookupStruct( const std::string & id ) const {
 		return atScope( 0 )->lookupStruct( id );
 	}
 
-	UnionDecl *Indexer::globalLookupUnion( const std::string &id ) const {
+	const UnionDecl * Indexer::globalLookupUnion( const std::string & id ) const {
 		return atScope( 0 )->lookupUnion( id );
 	}
 
-	EnumDecl *Indexer::globalLookupEnum( const std::string &id ) const {
+	const EnumDecl * Indexer::globalLookupEnum( const std::string & id ) const {
 		return atScope( 0 )->lookupEnum( id );
 	}
@@ -207,9 +212,9 @@
 	}
 
-	
-	bool Indexer::addedIdConflicts( 
-			const Indexer::IdData & existing, DeclarationWithType *added, 
+
+	bool Indexer::addedIdConflicts(
+			const Indexer::IdData & existing, DeclarationWithType * added,
 			Indexer::OnConflict handleConflicts, BaseSyntaxNode * deleteStmt ) {
-		// if we're giving the same name mangling to things of different types then there is 
+		// if we're giving the same name mangling to things of different types then there is
 		// something wrong
 		assert( (isObject( added ) && isObject( existing.id ) )
@@ -219,6 +224,6 @@
 			// new definition shadows the autogenerated one, even at the same scope
 			return false;
-		} else if ( LinkageSpec::isMangled( added->linkage ) 
-				|| ResolvExpr::typesCompatible( 
+		} else if ( LinkageSpec::isMangled( added->linkage )
+				|| ResolvExpr::typesCompatible(
 					added->get_type(), existing.id->get_type(), Indexer() ) ) {
 
@@ -238,7 +243,7 @@
 			if ( isDefinition( added ) && isDefinition( existing.id ) ) {
 				if ( handleConflicts.mode == OnConflict::Error ) {
-					SemanticError( added, 
-						isFunction( added ) ? 
-							"duplicate function definition for " : 
+					SemanticError( added,
+						isFunction( added ) ?
+							"duplicate function definition for " :
 							"duplicate object definition for " );
 				}
@@ -255,8 +260,8 @@
 	}
 
-	bool Indexer::hasCompatibleCDecl( const std::string &id, const std::string &mangleName ) const {
+	bool Indexer::hasCompatibleCDecl( const std::string & id, const std::string &mangleName ) const {
 		if ( ! idTable ) return false;
 
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto decls = idTable->find( id );
 		if ( decls == idTable->end() ) return false;
@@ -270,13 +275,13 @@
 			}
 		}
-		
+
 		return false;
 	}
 
-	bool Indexer::hasIncompatibleCDecl( 
-			const std::string &id, const std::string &mangleName ) const {
+	bool Indexer::hasIncompatibleCDecl(
+			const std::string & id, const std::string &mangleName ) const {
 		if ( ! idTable ) return false;
 
-		++*stats().map_lookups;
+		++* stats().map_lookups;
 		auto decls = idTable->find( id );
 		if ( decls == idTable->end() ) return false;
@@ -295,14 +300,14 @@
 
 	/// gets the base type of the first parameter; decl must be a ctor/dtor/assignment function
-	std::string getOtypeKey( FunctionDecl* function ) {
+	std::string getOtypeKey( FunctionDecl * function ) {
 		auto& params = function->type->parameters;
 		assert( ! params.empty() );
 		// use base type of pointer, so that qualifiers on the pointer type aren't considered.
-		Type* base = InitTweak::getPointerBase( params.front()->get_type() );
+		Type * base = InitTweak::getPointerBase( params.front()->get_type() );
 		assert( base );
 		return Mangler::mangle( base );
 	}
 
-	/// gets the declaration for the function acting on a type specified by otype key, 
+	/// gets the declaration for the function acting on a type specified by otype key,
 	/// nullptr if none such
 	FunctionDecl * getFunctionForOtype( DeclarationWithType * decl, const std::string& otypeKey ) {
@@ -312,13 +317,13 @@
 	}
 
-	bool Indexer::removeSpecialOverrides( 
+	bool Indexer::removeSpecialOverrides(
 			Indexer::IdData& data, Indexer::MangleTable::Ptr& mangleTable ) {
-		// if a type contains user defined ctor/dtor/assign, then special rules trigger, which 
-		// determinethe set of ctor/dtor/assign that can be used  by the requester. In particular, 
-		// if the user defines a default ctor, then the generated default ctor is unavailable, 
-		// likewise for copy ctor and dtor. If the user defines any ctor/dtor, then no generated 
-		// field ctors are available. If the user defines any ctor then the generated default ctor 
-		// is unavailable (intrinsic default ctor must be overridden exactly). If the user defines 
-		// anything that looks like a copy constructor, then the generated copy constructor is 
+		// if a type contains user defined ctor/dtor/assign, then special rules trigger, which
+		// determinethe set of ctor/dtor/assign that can be used  by the requester. In particular,
+		// if the user defines a default ctor, then the generated default ctor is unavailable,
+		// likewise for copy ctor and dtor. If the user defines any ctor/dtor, then no generated
+		// field ctors are available. If the user defines any ctor then the generated default ctor
+		// is unavailable (intrinsic default ctor must be overridden exactly). If the user defines
+		// anything that looks like a copy constructor, then the generated copy constructor is
 		// unavailable, and likewise for the assignment operator.
 
@@ -340,6 +345,6 @@
 			std::vector< MangleTable::value_type > deleted;
 			bool alreadyUserDefinedFunc = false;
-			
-			for ( const auto& entry : *mangleTable ) {
+
+			for ( const auto& entry : * mangleTable ) {
 				// skip decls that aren't functions or are for the wrong type
 				FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
@@ -368,9 +373,9 @@
 			// perform removals from mangle table, and deletions if necessary
 			for ( const auto& key : removed ) {
-				++*stats().map_mutations;
+				++* stats().map_mutations;
 				mangleTable = mangleTable->erase( key );
 			}
 			if ( ! alreadyUserDefinedFunc ) for ( const auto& entry : deleted ) {
-				++*stats().map_mutations;
+				++* stats().map_mutations;
 				mangleTable = mangleTable->set( entry.first, IdData{ entry.second, function } );
 			}
@@ -379,6 +384,6 @@
 			// if this is the first user-defined function, delete non-user-defined overloads
 			std::vector< MangleTable::value_type > deleted;
-			
-			for ( const auto& entry : *mangleTable ) {
+
+			for ( const auto& entry : * mangleTable ) {
 				// skip decls that aren't functions or are for the wrong type
 				FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
@@ -402,5 +407,5 @@
 			// this needs to be a separate loop because of iterator invalidation
 			for ( const auto& entry : deleted ) {
-				++*stats().map_mutations;
+				++* stats().map_mutations;
 				mangleTable = mangleTable->set( entry.first, IdData{ entry.second, function } );
 			}
@@ -408,5 +413,5 @@
 			// this is an overridable generated function
 			// if there already exists a matching user-defined function, delete this appropriately
-			for ( const auto& entry : *mangleTable ) {
+			for ( const auto& entry : * mangleTable ) {
 				// skip decls that aren't functions or are for the wrong type
 				FunctionDecl * decl = getFunctionForOtype( entry.second.id, dataOtypeKey );
@@ -418,5 +423,5 @@
 				if ( dataIsCopyFunc ) {
 					// remove current function if exists a user-defined copy function
-					// since the signatures for copy functions don't need to match exactly, using 
+					// since the signatures for copy functions don't need to match exactly, using
 					// a delete statement is the wrong approach
 					if ( InitTweak::isCopyFunction( decl, decl->name ) ) return false;
@@ -428,19 +433,19 @@
 			}
 		}
-		
+
 		// nothing (more) to fix, return true
 		return true;
 	}
 
-	void Indexer::addId( 
-			DeclarationWithType *decl, OnConflict handleConflicts, Expression * baseExpr, 
+	void Indexer::addId(
+			DeclarationWithType * decl, OnConflict handleConflicts, Expression * baseExpr,
 			BaseSyntaxNode * deleteStmt ) {
-		++*stats().add_calls;
+		++* stats().add_calls;
 		const std::string &name = decl->name;
 		if ( name == "" ) return;
-		
+
 		std::string mangleName;
 		if ( LinkageSpec::isOverridable( decl->linkage ) ) {
-			// mangle the name without including the appropriate suffix, so overridable routines 
+			// mangle the name without including the appropriate suffix, so overridable routines
 			// are placed into the same "bucket" as their user defined versions.
 			mangleName = Mangler::mangle( decl, false );
@@ -449,5 +454,5 @@
 		} // if
 
-		// this ensures that no two declarations with the same unmangled name at the same scope 
+		// this ensures that no two declarations with the same unmangled name at the same scope
 		// both have C linkage
 		if ( LinkageSpec::isMangled( decl->linkage ) ) {
@@ -457,5 +462,5 @@
 			}
 		} else {
-			// NOTE: only correct if name mangling is completely isomorphic to C 
+			// NOTE: only correct if name mangling is completely isomorphic to C
 			// type-compatibility, which it may not be.
 			if ( hasIncompatibleCDecl( name, mangleName ) ) {
@@ -470,5 +475,5 @@
 			mangleTable = MangleTable::new_ptr();
 		} else {
-			++*stats().map_lookups;
+			++* stats().map_lookups;
 			auto decls = idTable->find( name );
 			if ( decls == idTable->end() ) {
@@ -477,5 +482,5 @@
 				mangleTable = decls->second;
 				// skip in-scope repeat declarations of same identifier
-				++*stats().map_lookups;
+				++* stats().map_lookups;
 				auto existing = mangleTable->find( mangleName );
 				if ( existing != mangleTable->end()
@@ -486,9 +491,9 @@
 							// set delete expression for conflicting identifier
 							lazyInitScope();
-							*stats().map_mutations += 2;
+							* stats().map_mutations += 2;
 							idTable = idTable->set(
 								name,
-								mangleTable->set( 
-									mangleName, 
+								mangleTable->set(
+									mangleName,
 									IdData{ existing->second, handleConflicts.deleteStmt } ) );
 						}
@@ -504,5 +509,5 @@
 		// Ensure that auto-generated ctor/dtor/assignment are deleted if necessary
 		if ( ! removeSpecialOverrides( data, mangleTable ) ) return;
-		*stats().map_mutations += 2;
+		* stats().map_mutations += 2;
 		idTable = idTable->set( name, mangleTable->set( mangleName, std::move(data) ) );
 	}
@@ -518,5 +523,5 @@
 	}
 
-	bool addedTypeConflicts( NamedTypeDecl *existing, NamedTypeDecl *added ) {
+	bool addedTypeConflicts( NamedTypeDecl * existing, NamedTypeDecl * added ) {
 		if ( existing->base == nullptr ) {
 			return false;
@@ -530,29 +535,29 @@
 			}
 		}
-		// does not need to be added to the table if both existing and added have a base that are 
+		// does not need to be added to the table if both existing and added have a base that are
 		// the same
 		return true;
 	}
 
-	void Indexer::addType( NamedTypeDecl *decl ) {
-		++*stats().add_calls;
-		const std::string &id = decl->name;
-
-		if ( ! typeTable ) { 
+	void Indexer::addType( NamedTypeDecl * decl ) {
+		++* stats().add_calls;
+		const std::string & id = decl->name;
+
+		if ( ! typeTable ) {
 			typeTable = TypeTable::new_ptr();
 		} else {
-			++*stats().map_lookups;
+			++* stats().map_lookups;
 			auto existing = typeTable->find( id );
-			if ( existing != typeTable->end() 
-				&& existing->second.scope == scope 
+			if ( existing != typeTable->end()
+				&& existing->second.scope == scope
 				&& addedTypeConflicts( existing->second.decl, decl ) ) return;
 		}
-		
+
 		lazyInitScope();
-		++*stats().map_mutations;
+		++* stats().map_mutations;
 		typeTable = typeTable->set( id, Scoped<NamedTypeDecl>{ decl, scope } );
 	}
 
-	bool addedDeclConflicts( AggregateDecl *existing, AggregateDecl *added ) {
+	bool addedDeclConflicts( AggregateDecl * existing, AggregateDecl * added ) {
 		if ( ! existing->body ) {
 			return false;
@@ -563,89 +568,89 @@
 	}
 
-	void Indexer::addStruct( const std::string &id ) {
+	void Indexer::addStruct( const std::string & id ) {
 		addStruct( new StructDecl( id ) );
 	}
 
-	void Indexer::addStruct( StructDecl *decl ) {
-		++*stats().add_calls;
-		const std::string &id = decl->name;
+	void Indexer::addStruct( StructDecl * decl ) {
+		++* stats().add_calls;
+		const std::string & id = decl->name;
 
 		if ( ! structTable ) {
 			structTable = StructTable::new_ptr();
 		} else {
-			++*stats().map_lookups;
+			++* stats().map_lookups;
 			auto existing = structTable->find( id );
-			if ( existing != structTable->end()  
-				&& existing->second.scope == scope 
+			if ( existing != structTable->end()
+				&& existing->second.scope == scope
 				&& addedDeclConflicts( existing->second.decl, decl ) ) return;
 		}
 
 		lazyInitScope();
-		++*stats().map_mutations;
+		++* stats().map_mutations;
 		structTable = structTable->set( id, Scoped<StructDecl>{ decl, scope } );
 	}
 
-	void Indexer::addEnum( EnumDecl *decl ) {
-		++*stats().add_calls;
-		const std::string &id = decl->name;
+	void Indexer::addEnum( EnumDecl * decl ) {
+		++* stats().add_calls;
+		const std::string & id = decl->name;
 
 		if ( ! enumTable ) {
 			enumTable = EnumTable::new_ptr();
 		} else {
-			++*stats().map_lookups;
+			++* stats().map_lookups;
 			auto existing = enumTable->find( id );
-			if ( existing != enumTable->end()  
-				&& existing->second.scope == scope 
+			if ( existing != enumTable->end()
+				&& existing->second.scope == scope
 				&& addedDeclConflicts( existing->second.decl, decl ) ) return;
 		}
-		
+
 		lazyInitScope();
-		++*stats().map_mutations;
+		++* stats().map_mutations;
 		enumTable = enumTable->set( id, Scoped<EnumDecl>{ decl, scope } );
 	}
 
-	void Indexer::addUnion( const std::string &id ) {
+	void Indexer::addUnion( const std::string & id ) {
 		addUnion( new UnionDecl( id ) );
 	}
 
-	void Indexer::addUnion( UnionDecl *decl ) {
-		++*stats().add_calls;
-		const std::string &id = decl->name;
+	void Indexer::addUnion( UnionDecl * decl ) {
+		++* stats().add_calls;
+		const std::string & id = decl->name;
 
 		if ( ! unionTable ) {
 			unionTable = UnionTable::new_ptr();
 		} else {
-			++*stats().map_lookups;
+			++* stats().map_lookups;
 			auto existing = unionTable->find( id );
-			if ( existing != unionTable->end() 
-				&& existing->second.scope == scope 
+			if ( existing != unionTable->end()
+				&& existing->second.scope == scope
 				&& addedDeclConflicts( existing->second.decl, decl ) ) return;
 		}
 
 		lazyInitScope();
-		++*stats().map_mutations;
+		++* stats().map_mutations;
 		unionTable = unionTable->set( id, Scoped<UnionDecl>{ decl, scope } );
 	}
 
-	void Indexer::addTrait( TraitDecl *decl ) {
-		++*stats().add_calls;
-		const std::string &id = decl->name;
+	void Indexer::addTrait( TraitDecl * decl ) {
+		++* stats().add_calls;
+		const std::string & id = decl->name;
 
 		if ( ! traitTable ) {
 			traitTable = TraitTable::new_ptr();
 		} else {
-			++*stats().map_lookups;
+			++* stats().map_lookups;
 			auto existing = traitTable->find( id );
-			if ( existing != traitTable->end() 
-				&& existing->second.scope == scope 
+			if ( existing != traitTable->end()
+				&& existing->second.scope == scope
 				&& addedDeclConflicts( existing->second.decl, decl ) ) return;
 		}
 
 		lazyInitScope();
-		++*stats().map_mutations;
+		++* stats().map_mutations;
 		traitTable = traitTable->set( id, Scoped<TraitDecl>{ decl, scope } );
 	}
 
-	void Indexer::addMembers( AggregateDecl * aggr, Expression * expr, 
+	void Indexer::addMembers( AggregateDecl * aggr, Expression * expr,
 			OnConflict handleConflicts ) {
 		for ( Declaration * decl : aggr->members ) {
@@ -654,5 +659,5 @@
 				if ( dwt->name == "" ) {
 					Type * t = dwt->get_type()->stripReferences();
-					if ( dynamic_cast<StructInstType*>( t ) || dynamic_cast<UnionInstType*>( t ) ) {
+					if ( dynamic_cast<StructInstType *>( t ) || dynamic_cast<UnionInstType *>( t ) ) {
 						Expression * base = expr->clone();
 						ResolvExpr::Cost cost = ResolvExpr::Cost::zero; // xxx - carry this cost into the indexer as a base cost?
Index: src/SymTab/Indexer.h
===================================================================
--- src/SymTab/Indexer.h	(revision 7870799883ca946218c97fb6a189d1da90a16e8e)
+++ src/SymTab/Indexer.h	(revision fce4e31b3ccbea074ba05609992ef025123ea16a)
@@ -34,5 +34,5 @@
 		virtual ~Indexer();
 
-		// when using an indexer manually (e.g., within a mutator traversal), it is necessary to 
+		// when using an indexer manually (e.g., within a mutator traversal), it is necessary to
 		// tell the indexer explicitly when scopes begin and end
 		void enterScope();
@@ -50,7 +50,7 @@
 			// NOTE: shouldn't need either of these constructors, but gcc-4 does not properly support initializer lists with default members.
 			IdData() = default;
-			IdData( 
+			IdData(
 				DeclarationWithType * id, Expression * baseExpr, BaseSyntaxNode * deleteStmt,
-				unsigned long scope ) 
+				unsigned long scope )
 				: id( id ), baseExpr( baseExpr ), deleteStmt( deleteStmt ), scope( scope ) {}
 			IdData( const IdData& o, BaseSyntaxNode * deleteStmt )
@@ -61,35 +61,40 @@
 
 		/// Gets all declarations with the given ID
-		void lookupId( const std::string &id, std::list< IdData > &out ) const;
+		void lookupId( const std::string & id, std::list< IdData > &out ) const;
 		/// Gets the top-most type declaration with the given ID
-		NamedTypeDecl *lookupType( const std::string &id ) const;
+		const NamedTypeDecl * lookupType( const std::string & id ) const;
+		NamedTypeDecl * lookupMutableType( const std::string & id ) const;
 		/// Gets the top-most struct declaration with the given ID
-		StructDecl *lookupStruct( const std::string &id ) const;
+		const StructDecl * lookupStruct( const std::string & id ) const;
+		StructDecl * lookupMutableStruct( const std::string & id ) const;
 		/// Gets the top-most enum declaration with the given ID
-		EnumDecl *lookupEnum( const std::string &id ) const;
+		const EnumDecl * lookupEnum( const std::string & id ) const;
+		EnumDecl * lookupMutableEnum( const std::string & id ) const;
 		/// Gets the top-most union declaration with the given ID
-		UnionDecl *lookupUnion( const std::string &id ) const;
+		const UnionDecl * lookupUnion( const std::string & id ) const;
+		UnionDecl * lookupMutableUnion( const std::string & id ) const;
 		/// Gets the top-most trait declaration with the given ID
-		TraitDecl *lookupTrait( const std::string &id ) const;
+		const TraitDecl * lookupTrait( const std::string & id ) const;
+		TraitDecl * lookupMutableTrait( const std::string & id ) const;
 
 		/// Gets the type declaration with the given ID at global scope
-		NamedTypeDecl *globalLookupType( const std::string &id ) const;
+		const NamedTypeDecl * globalLookupType( const std::string & id ) const;
 		/// Gets the struct declaration with the given ID at global scope
-		StructDecl *globalLookupStruct( const std::string &id ) const;
+		const StructDecl * globalLookupStruct( const std::string & id ) const;
 		/// Gets the union declaration with the given ID at global scope
-		UnionDecl *globalLookupUnion( const std::string &id ) const;
+		const UnionDecl * globalLookupUnion( const std::string & id ) const;
 		/// Gets the enum declaration with the given ID at global scope
-		EnumDecl *globalLookupEnum( const std::string &id ) const;
+		const EnumDecl * globalLookupEnum( const std::string & id ) const;
 
 		void addId( DeclarationWithType * decl, Expression * baseExpr = nullptr );
 		void addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt );
 
-		void addType( NamedTypeDecl *decl );
-		void addStruct( const std::string &id );
-		void addStruct( StructDecl *decl );
-		void addEnum( EnumDecl *decl );
-		void addUnion( const std::string &id );
-		void addUnion( UnionDecl *decl );
-		void addTrait( TraitDecl *decl );
+		void addType( NamedTypeDecl * decl );
+		void addStruct( const std::string & id );
+		void addStruct( StructDecl * decl );
+		void addEnum( EnumDecl * decl );
+		void addUnion( const std::string & id );
+		void addUnion( UnionDecl * decl );
+		void addTrait( TraitDecl * decl );
 
 		/// adds all of the IDs from WithStmt exprs
@@ -106,11 +111,11 @@
 
 	  private:
-	  	/// Wraps a Decl* with a scope
+	  	/// Wraps a Decl * with a scope
 	  	template<typename Decl>
 		struct Scoped {
-			Decl* decl;           ///< declaration
+			Decl * decl;           ///< declaration
 			unsigned long scope;  ///< scope of this declaration
 
-			Scoped(Decl* d, unsigned long s) : decl(d), scope(s) {}
+			Scoped(Decl * d, unsigned long s) : decl(d), scope(s) {}
 		};
 
@@ -140,7 +145,7 @@
 
 		/// Gets the indexer at the given scope
-		const Indexer* atScope( unsigned long scope ) const;
+		const Indexer * atScope( unsigned long scope ) const;
 
-		/// Removes matching autogenerated constructors and destructors so that they will not be 
+		/// Removes matching autogenerated constructors and destructors so that they will not be
 		/// selected. If returns false, passed decl should not be added.
 		bool removeSpecialOverrides( IdData& decl, MangleTable::Ptr& mangleTable );
@@ -166,10 +171,10 @@
 		/// true if the existing identifier conflicts with the added identifier
 		bool addedIdConflicts(
-			const IdData& existing, DeclarationWithType * added, OnConflict handleConflicts, 
+			const IdData& existing, DeclarationWithType * added, OnConflict handleConflicts,
 			BaseSyntaxNode * deleteStmt );
 
 		/// common code for addId, addDeletedId, etc.
-		void addId( 
-			DeclarationWithType * decl, OnConflict handleConflicts, 
+		void addId(
+			DeclarationWithType * decl, OnConflict handleConflicts,
 			Expression * baseExpr = nullptr, BaseSyntaxNode * deleteStmt = nullptr );
 
@@ -178,7 +183,7 @@
 
 		/// returns true if there exists a declaration with C linkage and the given name with the same mangled name
-		bool hasCompatibleCDecl( const std::string &id, const std::string &mangleName ) const;
+		bool hasCompatibleCDecl( const std::string & id, const std::string &mangleName ) const;
 		/// returns true if there exists a declaration with C linkage and the given name with a different mangled name
-		bool hasIncompatibleCDecl( const std::string &id, const std::string &mangleName ) const;
+		bool hasIncompatibleCDecl( const std::string & id, const std::string &mangleName ) const;
 	};
 } // namespace SymTab
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 7870799883ca946218c97fb6a189d1da90a16e8e)
+++ src/SymTab/Validate.cc	(revision fce4e31b3ccbea074ba05609992ef025123ea16a)
@@ -119,5 +119,5 @@
 
 	  private:
-		template< typename AggDecl > void handleAggregate( AggDecl *aggregateDecl );
+		template< typename AggDecl > void handleAggregate( AggDecl * aggregateDecl );
 
 		AggregateDecl * parentAggr = nullptr;
@@ -134,32 +134,32 @@
 	/// Replaces enum types by int, and function or array types in function parameter and return lists by appropriate pointers.
 	struct EnumAndPointerDecay_old {
-		void previsit( EnumDecl *aggregateDecl );
-		void previsit( FunctionType *func );
+		void previsit( EnumDecl * aggregateDecl );
+		void previsit( FunctionType * func );
 	};
 
 	/// Associates forward declarations of aggregates with their definitions
 	struct LinkReferenceToTypes_old final : public WithIndexer, public WithGuards, public WithVisitorRef<LinkReferenceToTypes_old>, public WithShortCircuiting {
-		LinkReferenceToTypes_old( const Indexer *indexer );
-		void postvisit( TypeInstType *typeInst );
-
-		void postvisit( EnumInstType *enumInst );
-		void postvisit( StructInstType *structInst );
-		void postvisit( UnionInstType *unionInst );
-		void postvisit( TraitInstType *traitInst );
+		LinkReferenceToTypes_old( const Indexer * indexer );
+		void postvisit( TypeInstType * typeInst );
+
+		void postvisit( EnumInstType * enumInst );
+		void postvisit( StructInstType * structInst );
+		void postvisit( UnionInstType * unionInst );
+		void postvisit( TraitInstType * traitInst );
 		void previsit( QualifiedType * qualType );
 		void postvisit( QualifiedType * qualType );
 
-		void postvisit( EnumDecl *enumDecl );
-		void postvisit( StructDecl *structDecl );
-		void postvisit( UnionDecl *unionDecl );
+		void postvisit( EnumDecl * enumDecl );
+		void postvisit( StructDecl * structDecl );
+		void postvisit( UnionDecl * unionDecl );
 		void postvisit( TraitDecl * traitDecl );
 
-		void previsit( StructDecl *structDecl );
-		void previsit( UnionDecl *unionDecl );
+		void previsit( StructDecl * structDecl );
+		void previsit( UnionDecl * unionDecl );
 
 		void renameGenericParams( std::list< TypeDecl * > & params );
 
 	  private:
-		const Indexer *local_indexer;
+		const Indexer * local_indexer;
 
 		typedef std::map< std::string, std::list< EnumInstType * > > ForwardEnumsType;
@@ -239,5 +239,5 @@
 
 		template<typename AggDecl>
-		void handleAggregate( AggDecl *aggregateDecl );
+		void handleAggregate( AggDecl * aggregateDecl );
 
 		void previsit( StructDecl * aggregateDecl );
@@ -252,5 +252,5 @@
 		static void verify( std::list< Declaration * > &translationUnit );
 
-		void previsit( FunctionDecl *funcDecl );
+		void previsit( FunctionDecl * funcDecl );
 	};
 
@@ -287,6 +287,6 @@
 		Type::StorageClasses storageClasses;
 
-		void premutate( ObjectDecl *objectDecl );
-		Expression * postmutate( CompoundLiteralExpr *compLitExpr );
+		void premutate( ObjectDecl * objectDecl );
+		Expression * postmutate( CompoundLiteralExpr * compLitExpr );
 	};
 
@@ -393,5 +393,5 @@
 	}
 
-	void validateType( Type *type, const Indexer *indexer ) {
+	void validateType( Type * type, const Indexer * indexer ) {
 		PassVisitor<EnumAndPointerDecay_old> epc;
 		PassVisitor<LinkReferenceToTypes_old> lrt( indexer );
@@ -496,5 +496,5 @@
 	}
 
-	bool shouldHoist( Declaration *decl ) {
+	bool shouldHoist( Declaration * decl ) {
 		return dynamic_cast< StructDecl * >( decl ) || dynamic_cast< UnionDecl * >( decl ) || dynamic_cast< StaticAssertDecl * >( decl );
 	}
@@ -515,5 +515,5 @@
 
 	template< typename AggDecl >
-	void HoistStruct::handleAggregate( AggDecl *aggregateDecl ) {
+	void HoistStruct::handleAggregate( AggDecl * aggregateDecl ) {
 		if ( parentAggr ) {
 			aggregateDecl->parent = parentAggr;
@@ -560,5 +560,5 @@
 
 
-	bool isTypedef( Declaration *decl ) {
+	bool isTypedef( Declaration * decl ) {
 		return dynamic_cast< TypedefDecl * >( decl );
 	}
@@ -571,5 +571,5 @@
 
 	template< typename AggDecl >
-	void EliminateTypedef::handleAggregate( AggDecl *aggregateDecl ) {
+	void EliminateTypedef::handleAggregate( AggDecl * aggregateDecl ) {
 		filter( aggregateDecl->members, isTypedef, true );
 	}
@@ -586,5 +586,5 @@
 		// remove and delete decl stmts
 		filter( compoundStmt->kids, [](Statement * stmt) {
-			if ( DeclStmt *declStmt = dynamic_cast< DeclStmt * >( stmt ) ) {
+			if ( DeclStmt * declStmt = dynamic_cast< DeclStmt * >( stmt ) ) {
 				if ( dynamic_cast< TypedefDecl * >( declStmt->decl ) ) {
 					return true;
@@ -595,8 +595,8 @@
 	}
 
-	void EnumAndPointerDecay_old::previsit( EnumDecl *enumDecl ) {
+	void EnumAndPointerDecay_old::previsit( EnumDecl * enumDecl ) {
 		// Set the type of each member of the enumeration to be EnumConstant
 		for ( std::list< Declaration * >::iterator i = enumDecl->members.begin(); i != enumDecl->members.end(); ++i ) {
-			ObjectDecl * obj = dynamic_cast< ObjectDecl * >( *i );
+			ObjectDecl * obj = dynamic_cast< ObjectDecl * >( * i );
 			assert( obj );
 			obj->set_type( new EnumInstType( Type::Qualifiers( Type::Const ), enumDecl->name ) );
@@ -627,5 +627,5 @@
 	}
 
-	void EnumAndPointerDecay_old::previsit( FunctionType *func ) {
+	void EnumAndPointerDecay_old::previsit( FunctionType * func ) {
 		// Fix up parameters and return types
 		fixFunctionList( func->parameters, func->isVarArgs, func );
@@ -633,5 +633,5 @@
 	}
 
-	LinkReferenceToTypes_old::LinkReferenceToTypes_old( const Indexer *other_indexer ) {
+	LinkReferenceToTypes_old::LinkReferenceToTypes_old( const Indexer * other_indexer ) {
 		if ( other_indexer ) {
 			local_indexer = other_indexer;
@@ -641,6 +641,6 @@
 	}
 
-	void LinkReferenceToTypes_old::postvisit( EnumInstType *enumInst ) {
-		EnumDecl *st = local_indexer->lookupEnum( enumInst->name );
+	void LinkReferenceToTypes_old::postvisit( EnumInstType * enumInst ) {
+		EnumDecl * st = local_indexer->lookupMutableEnum( enumInst->name );
 		// it's not a semantic error if the enum is not found, just an implicit forward declaration
 		if ( st ) {
@@ -661,6 +661,6 @@
 	}
 
-	void LinkReferenceToTypes_old::postvisit( StructInstType *structInst ) {
-		StructDecl *st = local_indexer->lookupStruct( structInst->name );
+	void LinkReferenceToTypes_old::postvisit( StructInstType * structInst ) {
+		StructDecl * st = local_indexer->lookupMutableStruct( structInst->name );
 		// it's not a semantic error if the struct is not found, just an implicit forward declaration
 		if ( st ) {
@@ -674,6 +674,6 @@
 	}
 
-	void LinkReferenceToTypes_old::postvisit( UnionInstType *unionInst ) {
-		UnionDecl *un = local_indexer->lookupUnion( unionInst->name );
+	void LinkReferenceToTypes_old::postvisit( UnionInstType * unionInst ) {
+		UnionDecl * un = local_indexer->lookupMutableUnion( unionInst->name );
 		// it's not a semantic error if the union is not found, just an implicit forward declaration
 		if ( un ) {
@@ -693,5 +693,5 @@
 	void LinkReferenceToTypes_old::postvisit( QualifiedType * qualType ) {
 		// linking only makes sense for the 'oldest ancestor' of the qualified type
-		qualType->parent->accept( *visitor );
+		qualType->parent->accept( * visitor );
 	}
 
@@ -762,5 +762,5 @@
 	void LinkReferenceToTypes_old::postvisit( TraitInstType * traitInst ) {
 		// handle other traits
-		TraitDecl *traitDecl = local_indexer->lookupTrait( traitInst->name );
+		TraitDecl * traitDecl = local_indexer->lookupMutableTrait( traitInst->name );
 		if ( ! traitDecl ) {
 			SemanticError( traitInst->location, "use of undeclared trait " + traitInst->name );
@@ -786,5 +786,5 @@
 	}
 
-	void LinkReferenceToTypes_old::postvisit( EnumDecl *enumDecl ) {
+	void LinkReferenceToTypes_old::postvisit( EnumDecl * enumDecl ) {
 		// visit enum members first so that the types of self-referencing members are updated properly
 		if ( enumDecl->body ) {
@@ -792,5 +792,5 @@
 			if ( fwds != forwardEnums.end() ) {
 				for ( std::list< EnumInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) {
-					(*inst)->baseEnum = enumDecl;
+					(* inst)->baseEnum = enumDecl;
 				} // for
 				forwardEnums.erase( fwds );
@@ -834,5 +834,5 @@
 	}
 
-	void LinkReferenceToTypes_old::postvisit( StructDecl *structDecl ) {
+	void LinkReferenceToTypes_old::postvisit( StructDecl * structDecl ) {
 		// visit struct members first so that the types of self-referencing members are updated properly
 		// xxx - need to ensure that type parameters match up between forward declarations and definition (most importantly, number of type parameters and their defaults)
@@ -841,5 +841,5 @@
 			if ( fwds != forwardStructs.end() ) {
 				for ( std::list< StructInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) {
-					(*inst)->baseStruct = structDecl;
+					(* inst)->baseStruct = structDecl;
 				} // for
 				forwardStructs.erase( fwds );
@@ -848,10 +848,10 @@
 	}
 
-	void LinkReferenceToTypes_old::postvisit( UnionDecl *unionDecl ) {
+	void LinkReferenceToTypes_old::postvisit( UnionDecl * unionDecl ) {
 		if ( unionDecl->body ) {
 			ForwardUnionsType::iterator fwds = forwardUnions.find( unionDecl->name );
 			if ( fwds != forwardUnions.end() ) {
 				for ( std::list< UnionInstType * >::iterator inst = fwds->second.begin(); inst != fwds->second.end(); ++inst ) {
-					(*inst)->baseUnion = unionDecl;
+					(* inst)->baseUnion = unionDecl;
 				} // for
 				forwardUnions.erase( fwds );
@@ -860,10 +860,10 @@
 	}
 
-	void LinkReferenceToTypes_old::postvisit( TypeInstType *typeInst ) {
+	void LinkReferenceToTypes_old::postvisit( TypeInstType * typeInst ) {
 		// ensure generic parameter instances are renamed like the base type
 		if ( inGeneric && typeInst->baseType ) typeInst->name = typeInst->baseType->name;
-		if ( NamedTypeDecl *namedTypeDecl = local_indexer->lookupType( typeInst->name ) ) {
-			if ( TypeDecl *typeDecl = dynamic_cast< TypeDecl * >( namedTypeDecl ) ) {
-				typeInst->set_isFtype( typeDecl->get_kind() == TypeDecl::Ftype );
+		if ( const NamedTypeDecl * namedTypeDecl = local_indexer->lookupType( typeInst->name ) ) {
+			if ( const TypeDecl * typeDecl = dynamic_cast< const TypeDecl * >( namedTypeDecl ) ) {
+				typeInst->set_isFtype( typeDecl->kind == TypeDecl::Ftype );
 			} // if
 		} // if
@@ -877,5 +877,5 @@
 			// expand trait instances into their members
 			for ( DeclarationWithType * assertion : asserts ) {
-				if ( TraitInstType *traitInst = dynamic_cast< TraitInstType * >( assertion->get_type() ) ) {
+				if ( TraitInstType * traitInst = dynamic_cast< TraitInstType * >( assertion->get_type() ) ) {
 					// expand trait instance into all of its members
 					expandAssertions( traitInst, back_inserter( type->assertions ) );
@@ -897,5 +897,5 @@
 	}
 
-	void ForallPointerDecay_old::previsit( ObjectDecl *object ) {
+	void ForallPointerDecay_old::previsit( ObjectDecl * object ) {
 		// ensure that operator names only apply to functions or function pointers
 		if ( CodeGen::isOperator( object->name ) && ! dynamic_cast< FunctionType * >( object->type->stripDeclarator() ) ) {
@@ -905,5 +905,5 @@
 	}
 
-	void ForallPointerDecay_old::previsit( FunctionDecl *func ) {
+	void ForallPointerDecay_old::previsit( FunctionDecl * func ) {
 		func->fixUniqueId();
 	}
@@ -961,5 +961,5 @@
 	Type * ReplaceTypedef::postmutate( QualifiedType * qualType ) {
 		// replacing typedefs only makes sense for the 'oldest ancestor' of the qualified type
-		qualType->parent = qualType->parent->acceptMutator( *visitor );
+		qualType->parent = qualType->parent->acceptMutator( * visitor );
 		return qualType;
 	}
@@ -970,5 +970,5 @@
 		TypedefMap::const_iterator def = typedefNames.find( typeInst->name );
 		if ( def != typedefNames.end() ) {
-			Type *ret = def->second.first->base->clone();
+			Type * ret = def->second.first->base->clone();
 			ret->location = typeInst->location;
 			ret->get_qualifiers() |= typeInst->get_qualifiers();
@@ -982,5 +982,5 @@
 			// place instance parameters on the typedef'd type
 			if ( ! typeInst->parameters.empty() ) {
-				ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret);
+				ReferenceToType * rtt = dynamic_cast<ReferenceToType *>(ret);
 				if ( ! rtt ) {
 					SemanticError( typeInst->location, "Cannot apply type parameters to base type of " + typeInst->name );
@@ -988,5 +988,5 @@
 				rtt->parameters.clear();
 				cloneAll( typeInst->parameters, rtt->parameters );
-				mutateAll( rtt->parameters, *visitor );  // recursively fix typedefs on parameters
+				mutateAll( rtt->parameters, * visitor );  // recursively fix typedefs on parameters
 			} // if
 			delete typeInst;
@@ -1043,14 +1043,14 @@
 		//    struct screen;
 		// because the expansion of the typedef is:
-		//    void rtn( SCREEN *p ) => void rtn( struct screen *p )
+		//    void rtn( SCREEN * p ) => void rtn( struct screen * p )
 		// hence the type-name "screen" must be defined.
 		// Note, qualifiers on the typedef are superfluous for the forward declaration.
 
-		Type *designatorType = tyDecl->base->stripDeclarator();
-		if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( designatorType ) ) {
+		Type * designatorType = tyDecl->base->stripDeclarator();
+		if ( StructInstType * aggDecl = dynamic_cast< StructInstType * >( designatorType ) ) {
 			declsToAddBefore.push_back( new StructDecl( aggDecl->name, DeclarationNode::Struct, noAttributes, tyDecl->linkage ) );
-		} else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( designatorType ) ) {
+		} else if ( UnionInstType * aggDecl = dynamic_cast< UnionInstType * >( designatorType ) ) {
 			declsToAddBefore.push_back( new UnionDecl( aggDecl->name, noAttributes, tyDecl->linkage ) );
-		} else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) {
+		} else if ( EnumInstType * enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) {
 			declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage ) );
 		} // if
@@ -1078,5 +1078,5 @@
 
 	DeclarationWithType * ReplaceTypedef::postmutate( ObjectDecl * objDecl ) {
-		if ( FunctionType *funtype = dynamic_cast<FunctionType *>( objDecl->type ) ) { // function type?
+		if ( FunctionType * funtype = dynamic_cast<FunctionType *>( objDecl->type ) ) { // function type?
 			// replace the current object declaration with a function declaration
 			FunctionDecl * newDecl = new FunctionDecl( objDecl->name, objDecl->get_storageClasses(), objDecl->linkage, funtype, 0, objDecl->attributes, objDecl->get_funcSpec() );
@@ -1104,5 +1104,5 @@
 	void ReplaceTypedef::addImplicitTypedef( AggDecl * aggDecl ) {
 		if ( typedefNames.count( aggDecl->get_name() ) == 0 ) {
-			Type *type = nullptr;
+			Type * type = nullptr;
 			if ( StructDecl * newDeclStructDecl = dynamic_cast< StructDecl * >( aggDecl ) ) {
 				type = new StructInstType( Type::Qualifiers(), newDeclStructDecl->get_name() );
@@ -1130,5 +1130,5 @@
 		GuardScope( typedefNames );
 		GuardScope( typedeclNames );
-		mutateAll( aggr->parameters, *visitor );
+		mutateAll( aggr->parameters, * visitor );
 
 		// unroll mutateAll for aggr->members so that implicit typedefs for nested types are added to the aggregate body.
@@ -1137,5 +1137,5 @@
 
 			try {
-				*i = maybeMutate( *i, *visitor );
+				* i = maybeMutate( * i, * visitor );
 			} catch ( SemanticErrorException &e ) {
 				errors.append( e );
@@ -1217,11 +1217,11 @@
 			for ( size_t i = 0; paramIter != params->end(); ++paramIter, ++i ) {
 				if ( i < args.size() ) {
-					TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( *std::next( args.begin(), i ) );
-					sub.add( (*paramIter)->get_name(), expr->get_type()->clone() );
+					TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( * std::next( args.begin(), i ) );
+					sub.add( (* paramIter)->get_name(), expr->get_type()->clone() );
 				} else if ( i == args.size() ) {
-					Type * defaultType = (*paramIter)->get_init();
+					Type * defaultType = (* paramIter)->get_init();
 					if ( defaultType ) {
 						args.push_back( new TypeExpr( defaultType->clone() ) );
-						sub.add( (*paramIter)->get_name(), defaultType->clone() );
+						sub.add( (* paramIter)->get_name(), defaultType->clone() );
 					}
 				}
@@ -1242,14 +1242,14 @@
 	}
 
-	void CompoundLiteral::premutate( ObjectDecl *objectDecl ) {
+	void CompoundLiteral::premutate( ObjectDecl * objectDecl ) {
 		storageClasses = objectDecl->get_storageClasses();
 	}
 
-	Expression *CompoundLiteral::postmutate( CompoundLiteralExpr *compLitExpr ) {
+	Expression * CompoundLiteral::postmutate( CompoundLiteralExpr * compLitExpr ) {
 		// transform [storage_class] ... (struct S){ 3, ... };
 		// into [storage_class] struct S temp =  { 3, ... };
 		static UniqueName indexName( "_compLit" );
 
-		ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storageClasses, LinkageSpec::C, nullptr, compLitExpr->get_result(), compLitExpr->get_initializer() );
+		ObjectDecl * tempvar = new ObjectDecl( indexName.newName(), storageClasses, LinkageSpec::C, nullptr, compLitExpr->get_result(), compLitExpr->get_initializer() );
 		compLitExpr->set_result( nullptr );
 		compLitExpr->set_initializer( nullptr );
@@ -1289,5 +1289,5 @@
 			TupleType * tupleType = strict_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) );
 			// ensure return value is not destructed by explicitly creating an empty ListInit node wherein maybeConstruct is false.
-			ObjectDecl * newRet = new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) );
+			ObjectDecl * newRet = new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer *>(), noDesignators, false ) );
 			deleteAll( retVals );
 			retVals.clear();
@@ -1302,5 +1302,5 @@
 
 	void FixObjectType::previsit( ObjectDecl * objDecl ) {
-		Type *new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer );
+		Type * new_type = ResolvExpr::resolveTypeof( objDecl->get_type(), indexer );
 		new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
 		objDecl->set_type( new_type );
@@ -1308,12 +1308,12 @@
 
 	void FixObjectType::previsit( FunctionDecl * funcDecl ) {
-		Type *new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer );
+		Type * new_type = ResolvExpr::resolveTypeof( funcDecl->type, indexer );
 		new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
 		funcDecl->set_type( new_type );
 	}
 
-	void FixObjectType::previsit( TypeDecl *typeDecl ) {
+	void FixObjectType::previsit( TypeDecl * typeDecl ) {
 		if ( typeDecl->get_base() ) {
-			Type *new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer );
+			Type * new_type = ResolvExpr::resolveTypeof( typeDecl->get_base(), indexer );
 			new_type->get_qualifiers() -= Type::Lvalue; // even if typeof is lvalue, variable can never have lvalue-qualified type
 			typeDecl->set_base( new_type );
@@ -1378,5 +1378,5 @@
 
 namespace {
-	/// Replaces enum types by int, and function/array types in function parameter and return 
+	/// Replaces enum types by int, and function/array types in function parameter and return
 	/// lists by appropriate pointers
 	struct EnumAndPointerDecay_new {
@@ -1385,9 +1385,9 @@
 			for ( unsigned i = 0; i < enumDecl->members.size(); ++i ) {
 				// build new version of object with EnumConstant
-				ast::ptr< ast::ObjectDecl > obj = 
+				ast::ptr< ast::ObjectDecl > obj =
 					enumDecl->members[i].strict_as< ast::ObjectDecl >();
-				obj.get_and_mutate()->type = 
+				obj.get_and_mutate()->type =
 					new ast::EnumInstType{ enumDecl->name, ast::CV::Const };
-				
+
 				// set into decl
 				ast::EnumDecl * mut = mutate( enumDecl );
@@ -1399,9 +1399,9 @@
 
 		static const ast::FunctionType * fixFunctionList(
-			const ast::FunctionType * func, 
+			const ast::FunctionType * func,
 			std::vector< ast::ptr< ast::DeclWithType > > ast::FunctionType::* field,
 			ast::ArgumentFlag isVarArgs = ast::FixedArgs
 		) {
-			const auto & dwts = func->*field;
+			const auto & dwts = func->* field;
 			unsigned nvals = dwts.size();
 			bool hasVoid = false;
@@ -1409,8 +1409,8 @@
 				func = ast::mutate_field_index( func, field, i, fixFunction( dwts[i], hasVoid ) );
 			}
-			
+
 			// the only case in which "void" is valid is where it is the only one in the list
 			if ( hasVoid && ( nvals > 1 || isVarArgs ) ) {
-				SemanticError( 
+				SemanticError(
 					dwts.front()->location, func, "invalid type void in function type" );
 			}
@@ -1418,5 +1418,5 @@
 			// one void is the only thing in the list, remove it
 			if ( hasVoid ) {
-				func = ast::mutate_field( 
+				func = ast::mutate_field(
 					func, field, std::vector< ast::ptr< ast::DeclWithType > >{} );
 			}
@@ -1432,11 +1432,11 @@
 
 	/// expand assertions from a trait instance, performing appropriate type variable substitutions
-	void expandAssertions( 
-		const ast::TraitInstType * inst, std::vector< ast::ptr< ast::DeclWithType > > & out 
+	void expandAssertions(
+		const ast::TraitInstType * inst, std::vector< ast::ptr< ast::DeclWithType > > & out
 	) {
 		assertf( inst->base, "Trait instance not linked to base trait: %s", toCString( inst ) );
 
 		// build list of trait members, substituting trait decl parameters for instance parameters
-		ast::TypeSubstitution sub{ 
+		ast::TypeSubstitution sub{
 			inst->base->params.begin(), inst->base->params.end(), inst->params.begin() };
 		// deliberately take ast::ptr by-value to ensure this does not mutate inst->base
@@ -1449,25 +1449,25 @@
 
 	/// Associates forward declarations of aggregates with their definitions
-	class LinkReferenceToTypes_new final 
-	: public ast::WithSymbolTable, public ast::WithGuards, public 
+	class LinkReferenceToTypes_new final
+	: public ast::WithSymbolTable, public ast::WithGuards, public
 	  ast::WithVisitorRef<LinkReferenceToTypes_new>, public ast::WithShortCircuiting {
-		
-		// these maps of uses of forward declarations of types need to have the actual type 
-		// declaration switched in *after* they have been traversed. To enable this in the 
-		// ast::Pass framework, any node that needs to be so mutated has mutate() called on it 
-		// before it is placed in the map, properly updating its parents in the usual traversal, 
+
+		// these maps of uses of forward declarations of types need to have the actual type
+		// declaration switched in * after * they have been traversed. To enable this in the
+		// ast::Pass framework, any node that needs to be so mutated has mutate() called on it
+		// before it is placed in the map, properly updating its parents in the usual traversal,
 		// then can have the actual mutation applied later
 		using ForwardEnumsType = std::unordered_multimap< std::string, ast::EnumInstType * >;
 		using ForwardStructsType = std::unordered_multimap< std::string, ast::StructInstType * >;
 		using ForwardUnionsType = std::unordered_multimap< std::string, ast::UnionInstType * >;
-		
+
 		const CodeLocation & location;
 		const ast::SymbolTable * localSymtab;
-		
+
 		ForwardEnumsType forwardEnums;
 		ForwardStructsType forwardStructs;
 		ForwardUnionsType forwardUnions;
 
-		/// true if currently in a generic type body, so that type parameter instances can be 
+		/// true if currently in a generic type body, so that type parameter instances can be
 		/// renamed appropriately
 		bool inGeneric = false;
@@ -1475,9 +1475,9 @@
 	public:
 		/// contstruct using running symbol table
-		LinkReferenceToTypes_new( const CodeLocation & loc ) 
+		LinkReferenceToTypes_new( const CodeLocation & loc )
 		: location( loc ), localSymtab( &symtab ) {}
-		
+
 		/// construct using provided symbol table
-		LinkReferenceToTypes_new( const CodeLocation & loc, const ast::SymbolTable & syms ) 
+		LinkReferenceToTypes_new( const CodeLocation & loc, const ast::SymbolTable & syms )
 		: location( loc ), localSymtab( &syms ) {}
 
@@ -1485,11 +1485,11 @@
 			// ensure generic parameter instances are renamed like the base type
 			if ( inGeneric && typeInst->base ) {
-				typeInst = ast::mutate_field( 
+				typeInst = ast::mutate_field(
 					typeInst, &ast::TypeInstType::name, typeInst->base->name );
 			}
 
-			if ( 
-				auto typeDecl = dynamic_cast< const ast::TypeDecl * >( 
-					localSymtab->lookupType( typeInst->name ) ) 
+			if (
+				auto typeDecl = dynamic_cast< const ast::TypeDecl * >(
+					localSymtab->lookupType( typeInst->name ) )
 			) {
 				typeInst = ast::mutate_field( typeInst, &ast::TypeInstType::kind, typeDecl->kind );
@@ -1517,5 +1517,5 @@
 			for ( const ast::Expr * param : inst->params ) {
 				if ( ! dynamic_cast< const ast::TypeExpr * >( param ) ) {
-					SemanticError( 
+					SemanticError(
 						location, inst, "Expression parameters for generic types are currently "
 						"unsupported: " );
@@ -1571,5 +1571,5 @@
 				auto expr = traitInst->params[i].as< ast::TypeExpr >();
 				if ( ! expr ) {
-					SemanticError( 
+					SemanticError(
 						traitInst->params[i].get(), "Expression parameters for trait instances "
 						"are currently unsupported: " );
@@ -1593,15 +1593,15 @@
 			return traitInst;
 		}
-		
+
 		void previsit( const ast::QualifiedType * ) { visit_children = false; }
-		
+
 		const ast::Type * postvisit( const ast::QualifiedType * qualType ) {
 			// linking only makes sense for the "oldest ancestor" of the qualified type
-			return ast::mutate_field( 
-				qualType, &ast::QualifiedType::parent, qualType->parent->accept( *visitor ) );
+			return ast::mutate_field(
+				qualType, &ast::QualifiedType::parent, qualType->parent->accept( * visitor ) );
 		}
 
 		const ast::Decl * postvisit( const ast::EnumDecl * enumDecl ) {
-			// visit enum members first so that the types of self-referencing members are updated 
+			// visit enum members first so that the types of self-referencing members are updated
 			// properly
 			if ( ! enumDecl->body ) return enumDecl;
@@ -1612,23 +1612,23 @@
 				auto inst = fwds.first;
 				do {
-					// forward decl is stored *mutably* in map, can thus be updated
+					// forward decl is stored * mutably * in map, can thus be updated
 					inst->second->base = enumDecl;
 				} while ( ++inst != fwds.second );
 				forwardEnums.erase( fwds.first, fwds.second );
 			}
-			
+
 			// ensure that enumerator initializers are properly set
 			for ( unsigned i = 0; i < enumDecl->members.size(); ++i ) {
 				auto field = enumDecl->members[i].strict_as< ast::ObjectDecl >();
 				if ( field->init ) {
-					// need to resolve enumerator initializers early so that other passes that 
+					// need to resolve enumerator initializers early so that other passes that
 					// determine if an expression is constexpr have appropriate information
 					auto init = field->init.strict_as< ast::SingleInit >();
-					
-					enumDecl = ast::mutate_field_index( 
-						enumDecl, &ast::EnumDecl::members, i, 
-						ast::mutate_field( field, &ast::ObjectDecl::init, 
+
+					enumDecl = ast::mutate_field_index(
+						enumDecl, &ast::EnumDecl::members, i,
+						ast::mutate_field( field, &ast::ObjectDecl::init,
 							ast::mutate_field( init, &ast::SingleInit::value,
-								ResolvExpr::findSingleExpression( 
+								ResolvExpr::findSingleExpression(
 									init->value, new ast::BasicType{ ast::BasicType::SignedInt },
 									symtab ) ) ) );
@@ -1639,5 +1639,5 @@
 		}
 
-		/// rename generic type parameters uniquely so that they do not conflict with user defined 
+		/// rename generic type parameters uniquely so that they do not conflict with user defined
 		/// function forall parameters, e.g. the T in Box and the T in f, below
 		///   forall(otype T)
@@ -1657,6 +1657,6 @@
 				const ast::TypeDecl * td = aggr->params[i];
 
-				aggr = ast::mutate_field_index( 
-					aggr, &AggrDecl::params, i, 
+				aggr = ast::mutate_field_index(
+					aggr, &AggrDecl::params, i,
 					ast::mutate_field( td, &ast::TypeDecl::name, "__" + td->name + "_generic_" ) );
 			}
@@ -1669,5 +1669,5 @@
 
 		void postvisit( const ast::StructDecl * structDecl ) {
-			// visit struct members first so that the types of self-referencing members are 
+			// visit struct members first so that the types of self-referencing members are
 			// updated properly
 			if ( ! structDecl->body ) return;
@@ -1678,5 +1678,5 @@
 				auto inst = fwds.first;
 				do {
-					// forward decl is stored *mutably* in map, can thus be updated
+					// forward decl is stored * mutably * in map, can thus be updated
 					inst->second->base = structDecl;
 				} while ( ++inst != fwds.second );
@@ -1690,5 +1690,5 @@
 
 		void postvisit( const ast::UnionDecl * unionDecl ) {
-			// visit union members first so that the types of self-referencing members are updated 
+			// visit union members first so that the types of self-referencing members are updated
 			// properly
 			if ( ! unionDecl->body ) return;
@@ -1699,5 +1699,5 @@
 				auto inst = fwds.first;
 				do {
-					// forward decl is stored *mutably* in map, can thus be updated
+					// forward decl is stored * mutably * in map, can thus be updated
 					inst->second->base = unionDecl;
 				} while ( ++inst != fwds.second );
@@ -1712,7 +1712,7 @@
 					"number of parameters: %zd", traitDecl->params.size() );
 
-				traitDecl = ast::mutate_field_index( 
-					traitDecl, &ast::TraitDecl::params, 0, 
-					ast::mutate_field( 
+				traitDecl = ast::mutate_field_index(
+					traitDecl, &ast::TraitDecl::params, 0,
+					ast::mutate_field(
 						traitDecl->params.front().get(), &ast::TypeDecl::sized, true ) );
 			}
@@ -1737,10 +1737,10 @@
 				traitDecl = mut;
 			}
-			
+
 			return traitDecl;
 		}
 	};
 
-	/// Replaces array and function types in forall lists by appropriate pointer type and assigns 
+	/// Replaces array and function types in forall lists by appropriate pointer type and assigns
 	/// each object and function declaration a unique ID
 	class ForallPointerDecay_new {
@@ -1751,6 +1751,6 @@
 		const ast::ObjectDecl * previsit( const ast::ObjectDecl * obj ) {
 			// ensure that operator names only apply to functions or function pointers
-			if ( 
-				CodeGen::isOperator( obj->name ) 
+			if (
+				CodeGen::isOperator( obj->name )
 				&& ! dynamic_cast< const ast::FunctionType * >( obj->type->stripDeclarator() )
 			) {
@@ -1776,10 +1776,10 @@
 		/// Fix up assertions -- flattens assertion lists, removing all trait instances
 		template< typename node_t, typename parent_t >
-		static const node_t * forallFixer( 
-			const CodeLocation & loc, const node_t * node, 
+		static const node_t * forallFixer(
+			const CodeLocation & loc, const node_t * node,
 			ast::ParameterizedType::ForallList parent_t::* forallField
 		) {
-			for ( unsigned i = 0; i < (node->*forallField).size(); ++i ) {
-				const ast::TypeDecl * type = (node->*forallField)[i];
+			for ( unsigned i = 0; i < (node->* forallField).size(); ++i ) {
+				const ast::TypeDecl * type = (node->* forallField)[i];
 				if ( type->assertions.empty() ) continue;
 
@@ -1789,6 +1789,6 @@
 				// expand trait instances into their members
 				for ( const ast::DeclWithType * assn : type->assertions ) {
-					auto traitInst = 
-						dynamic_cast< const ast::TraitInstType * >( assn->get_type() ); 
+					auto traitInst =
+						dynamic_cast< const ast::TraitInstType * >( assn->get_type() );
 					if ( traitInst ) {
 						// expand trait instance to all its members
@@ -1831,5 +1831,5 @@
 } // anonymous namespace
 
-const ast::Type * validateType( 
+const ast::Type * validateType(
 		const CodeLocation & loc, const ast::Type * type, const ast::SymbolTable & symtab ) {
 	ast::Pass< EnumAndPointerDecay_new > epc;
