Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/CodeGen/CodeGenerator.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// CodeGenerator.cc -- 
+// CodeGenerator.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Thu Sep 17 15:25:58 2015
-// Update Count     : 233
+// Last Modified On : Wed Jan 13 16:26:59 2016
+// Update Count     : 234
 //
 
@@ -98,5 +98,5 @@
 		handleStorageClass( objectDecl );
 		output << genType( objectDecl->get_type(), mangleName( objectDecl ) );
-	
+
 		if ( objectDecl->get_init() ) {
 			output << " = ";
@@ -112,5 +112,5 @@
 		if ( aggDecl->get_name() != "" )
 			output << aggDecl->get_name();
-	
+
 		std::list< Declaration * > &memb = aggDecl->get_members();
 
@@ -118,12 +118,12 @@
 			output << " {" << endl;
 
-			cur_indent += CodeGenerator::tabsize; 
+			cur_indent += CodeGenerator::tabsize;
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
-				output << indent; 
+				output << indent;
 				(*i)->accept( *this );
 				output << ";" << endl;
 			}
 
-			cur_indent -= CodeGenerator::tabsize; 
+			cur_indent -= CodeGenerator::tabsize;
 
 			output << indent << "}";
@@ -140,5 +140,5 @@
 		handleAggregate( aggregateDecl );
 	}
-  
+
 	void CodeGenerator::visit( EnumDecl *aggDecl ) {
 		output << "enum ";
@@ -146,5 +146,5 @@
 		if ( aggDecl->get_name() != "" )
 			output << aggDecl->get_name();
-	
+
 		std::list< Declaration* > &memb = aggDecl->get_members();
 
@@ -152,9 +152,9 @@
 			output << " {" << endl;
 
-			cur_indent += CodeGenerator::tabsize; 
+			cur_indent += CodeGenerator::tabsize;
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
 				ObjectDecl *obj = dynamic_cast< ObjectDecl* >( *i );
 				assert( obj );
-				output << indent << mangleName( obj ); 
+				output << indent << mangleName( obj );
 				if ( obj->get_init() ) {
 					output << " = ";
@@ -164,17 +164,17 @@
 			} // for
 
-			cur_indent -= CodeGenerator::tabsize; 
+			cur_indent -= CodeGenerator::tabsize;
 
 			output << indent << "}";
 		} // if
 	}
-  
+
 	void CodeGenerator::visit( ContextDecl *aggregateDecl ) {}
-  
+
 	void CodeGenerator::visit( TypedefDecl *typeDecl ) {
 		output << "typedef ";
 		output << genType( typeDecl->get_base(), typeDecl->get_name() );
 	}
-  
+
 	void CodeGenerator::visit( TypeDecl *typeDecl ) {
 		// really, we should mutate this into something that isn't a TypeDecl but that requires large-scale changes,
@@ -216,5 +216,5 @@
 	}
 
-	void CodeGenerator::visit( Constant *constant ) { 
+	void CodeGenerator::visit( Constant *constant ) {
 		output << constant->get_value() ;
 	}
@@ -233,5 +233,5 @@
 						assert( arg != applicationExpr->get_args().end() );
 						if ( AddressExpr *addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) {
-	        
+
 							*arg = addrExpr->get_arg();
 						} else {
@@ -242,10 +242,10 @@
 						break;
 					}
-	      
+
 				  default:
 					// do nothing
 					;
 				}
-	    
+
 				switch ( opInfo.type ) {
 				  case OT_INDEX:
@@ -256,5 +256,5 @@
 					output << "]";
 					break;
-	      
+
 				  case OT_CALL:
 				  case OT_CTOR:
@@ -263,5 +263,5 @@
 					assert( false );
 					break;
-	      
+
 				  case OT_PREFIX:
 				  case OT_PREFIXASSIGN:
@@ -272,5 +272,5 @@
 					output << ")";
 					break;
-	      
+
 				  case OT_POSTFIX:
 				  case OT_POSTFIXASSIGN:
@@ -289,5 +289,5 @@
 					output << ")";
 					break;
-	      
+
 				  case OT_CONSTANT:
 				  case OT_LABELADDRESS:
@@ -308,5 +308,5 @@
 		} // if
 	}
-  
+
 	void CodeGenerator::visit( UntypedExpr *untypedExpr ) {
 		if ( NameExpr *nameExpr = dynamic_cast< NameExpr* >( untypedExpr->get_function() ) ) {
@@ -322,5 +322,5 @@
 					output << "]";
 					break;
-	      
+
 				  case OT_CALL:
 					case OT_CTOR:
@@ -328,5 +328,5 @@
 					assert( false );
 					break;
-	      
+
 				  case OT_PREFIX:
 				  case OT_PREFIXASSIGN:
@@ -338,5 +338,5 @@
 					output << ")";
 					break;
-	      
+
 				  case OT_POSTFIX:
 				  case OT_POSTFIXASSIGN:
@@ -345,5 +345,5 @@
 					output << opInfo.symbol;
 					break;
-  
+
 				  case OT_INFIX:
 				  case OT_INFIXASSIGN:
@@ -355,5 +355,5 @@
 					output << ")";
 					break;
-					
+
 				  case OT_CONSTANT:
 					// there are no intrinsic definitions of 0 or 1 as functions
@@ -373,5 +373,5 @@
 		} // if
 	}
-  
+
 	void CodeGenerator::visit( NameExpr *nameExpr ) {
 		OperatorInfo opInfo;
@@ -383,5 +383,5 @@
 		} // if
 	}
-  
+
 	void CodeGenerator::visit( AddressExpr *addressExpr ) {
 		output << "(&";
@@ -410,17 +410,17 @@
 			output << ")";
 			castExpr->get_arg()->accept( *this );
-			output << ")";			
+			output << ")";
 		}
 	}
-  
+
 	void CodeGenerator::visit( UntypedMemberExpr *memberExpr ) {
 		assert( false );
 	}
-  
+
 	void CodeGenerator::visit( MemberExpr *memberExpr ) {
 		memberExpr->get_aggregate()->accept( *this );
 		output << "." << mangleName( memberExpr->get_member() );
 	}
-  
+
 	void CodeGenerator::visit( VariableExpr *variableExpr ) {
 		OperatorInfo opInfo;
@@ -431,10 +431,10 @@
 		} // if
 	}
-  
+
 	void CodeGenerator::visit( ConstantExpr *constantExpr ) {
 		assert( constantExpr->get_constant() );
 		constantExpr->get_constant()->accept( *this );
 	}
-  
+
 	void CodeGenerator::visit( SizeofExpr *sizeofExpr ) {
 		output << "sizeof(";
@@ -457,5 +457,5 @@
 		output << ")";
 	}
-  
+
 	void CodeGenerator::visit( LogicalExpr *logicalExpr ) {
 		output << "(";
@@ -469,5 +469,5 @@
 		output << ")";
 	}
-  
+
 	void CodeGenerator::visit( ConditionalExpr *conditionalExpr ) {
 		output << "(";
@@ -479,5 +479,5 @@
 		output << ")";
 	}
-  
+
 	void CodeGenerator::visit( CommaExpr *commaExpr ) {
 		output << "(";
@@ -487,7 +487,7 @@
 		output << ")";
 	}
-  
+
 	void CodeGenerator::visit( TupleExpr *tupleExpr ) {}
-  
+
 	void CodeGenerator::visit( TypeExpr *typeExpr ) {}
 
@@ -520,5 +520,5 @@
 			}
 		}
-		cur_indent -= CodeGenerator::tabsize; 
+		cur_indent -= CodeGenerator::tabsize;
 
 		output << indent << "}";
@@ -526,6 +526,6 @@
 
 	void CodeGenerator::visit( ExprStmt *exprStmt ) {
-		// I don't see why this check is necessary. 
-		// If this starts to cause problems then put it back in, 
+		// I don't see why this check is necessary.
+		// If this starts to cause problems then put it back in,
 		// with an explanation
 		assert( exprStmt );
@@ -577,5 +577,5 @@
 		switchStmt->get_condition()->accept( *this );
 		output << " ) ";
-		
+
 		output << "{" << std::endl;
 		cur_indent += CodeGenerator::tabsize;
@@ -597,5 +597,5 @@
 		} // if
 		output << ":\n";
-		
+
 		std::list<Statement *> sts = caseStmt->get_statements();
 
@@ -614,5 +614,5 @@
 			if ( ! branchStmt->get_target().empty() )
 				output << "goto " << branchStmt->get_target();
-			else { 
+			else {
 				if ( branchStmt->get_computedTarget() != 0 ) {
 					output << "goto *";
@@ -665,6 +665,6 @@
 
 	void CodeGenerator::visit( ForStmt *forStmt ) {
-		// initialization is always hoisted, so don't 
-		// bother doing anything with that 
+		// initialization is always hoisted, so don't
+		// bother doing anything with that
 		output << "for (;";
 
@@ -690,5 +690,5 @@
 	void CodeGenerator::visit( DeclStmt *declStmt ) {
 		declStmt->get_decl()->accept( *this );
-	
+
 		if ( doSemicolon( declStmt->get_decl() ) ) {
 			output << ";";
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
+++ src/InitTweak/FixInit.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -0,0 +1,76 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// FixInit.h --
+//
+// Author           : Rob Schluntz
+// Created On       : Wed Jan 13 16:29:30 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 16:45:37 2016
+// Update Count     : 17
+//
+
+#include <stack>
+#include <list>
+#include "RemoveInit.h"
+#include "SynTree/Declaration.h"
+#include "SynTree/Type.h"
+#include "SynTree/Expression.h"
+#include "SynTree/Statement.h"
+#include "SynTree/Initializer.h"
+#include "SynTree/Mutator.h"
+#include "GenPoly/PolyMutator.h"
+
+namespace InitTweak {
+	namespace {
+		const std::list<Label> noLabels;
+	}
+
+	class FixInit : public GenPoly::PolyMutator {
+	  public:
+		static void fixInitializers( std::list< Declaration * > &translationUnit );
+
+		virtual ObjectDecl * mutate( ObjectDecl *objDecl );
+	};
+
+	void fix( std::list< Declaration * > & translationUnit ) {
+		FixInit::fixInitializers( translationUnit );
+	}
+
+	void FixInit::fixInitializers( std::list< Declaration * > & translationUnit ) {
+		FixInit fixer;
+		mutateAll( translationUnit, fixer );
+	}
+
+	// in the case where an object has an initializer and a polymorphic type, insert an assignment immediately after the
+	// declaration. This will (seemingly) cause the later phases to do the right thing with the assignment
+	ObjectDecl *FixInit::mutate( ObjectDecl *objDecl ) {
+		if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
+			// a decision should have been made by the resolver, so either ctor is NULL or init is NULL
+			assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
+			if ( Expression * ctor = ctorInit->get_ctor() ) {
+				ExprStmt * ctorStmt = new ExprStmt( noLabels, ctor );
+				stmtsToAddAfter.push_back( ctorStmt );
+				objDecl->set_init( NULL );
+				ctorInit->set_ctor( NULL );
+			} else if ( Initializer * init = ctorInit->get_init() ) {
+				objDecl->set_init( init );
+				ctorInit->set_init( NULL );
+			} else {
+				// one of them should be non-NULL
+				assert( ctorInit->get_ctor() || ctorInit->get_init() );
+			}
+			delete ctorInit;
+		}
+		return objDecl;
+	}
+} // namespace InitTweak
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/InitTweak/FixInit.h
===================================================================
--- src/InitTweak/FixInit.h	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
+++ src/InitTweak/FixInit.h	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -0,0 +1,38 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// FixInit.h --
+//
+// Author           : Rob Schluntz
+// Created On       : Wed Jan 13 16:29:30 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 16:31:13 2016
+// Update Count     : 5
+//
+
+#ifndef FIX_INIT_H
+#define FIX_INIT_H
+
+#include <string>
+#include <list>
+
+#include "SynTree/SynTree.h"
+#include "SynTree/Declaration.h"
+#include "SynTree/Mutator.h"
+
+namespace InitTweak {
+  /// replace constructor initializers with expression statements
+  /// and unwrap basic C-style initializers
+	void fix( std::list< Declaration * > & translationUnit );
+} // namespace
+
+#endif // GENPOLY_POLYMUTATOR_H
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/InitTweak/RemoveInit.cc
===================================================================
--- src/InitTweak/RemoveInit.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/InitTweak/RemoveInit.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Mon Jan 11 16:10:45 2016
-// Update Count     : 150
+// Last Modified On : Wed Jan 13 15:19:35 2016
+// Update Count     : 154
 //
 
@@ -148,9 +148,9 @@
 		}
 
-		ExprStmt * makeCtorDtorStmt( std::string name, ObjectDecl * objDecl, std::list< Expression * > args ) {
+		Expression * makeCtorDtorExpr( std::string name, ObjectDecl * objDecl, std::list< Expression * > args ) {
 			UntypedExpr * expr = new UntypedExpr( new NameExpr( name ) );
 			expr->get_args().push_back( new AddressExpr( new VariableExpr( objDecl ) ) );
 			expr->get_args().splice( expr->get_args().end(), args );
-			return new ExprStmt( noLabels, expr );
+			return expr;
 		}
 
@@ -186,12 +186,12 @@
 		// hands off if designated or if @=
 		if ( tryConstruct( objDecl ) ) {
-			ExprStmt * ctor = makeCtorDtorStmt( "?{}", objDecl, makeInitList( objDecl->get_init() ) );
-			ExprStmt * dtor = makeCtorDtorStmt( "^?{}", objDecl, std::list< Expression * >() );
-
-			// set_ctor...
+			Expression * ctor = makeCtorDtorExpr( "?{}", objDecl, makeInitList( objDecl->get_init() ) );
+			Expression * dtor = makeCtorDtorExpr( "^?{}", objDecl, std::list< Expression * >() );
+
 			// need to remember init expression, in case no ctors exist
-			// if ctor does exist, want to use ctor stmt instead of init
-			objDecl->set_ctor( ctor );
-			destructorStmts.push_front( dtor );
+			// if ctor does exist, want to use ctor expression instead of init
+			// push this decision to the resolver
+			objDecl->set_init( new ConstructorInit( ctor, objDecl->get_init() ) );
+			destructorStmts.push_front( new ExprStmt( noLabels, dtor ) );
 		}
 		return objDecl;
Index: src/InitTweak/module.mk
===================================================================
--- src/InitTweak/module.mk	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/InitTweak/module.mk	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -11,8 +11,8 @@
 ## Created On       : Mon Jun  1 17:49:17 2015
 ## Last Modified By : Rob Schluntz
-## Last Modified On : Mon Jan 11 14:40:16 2016
-## Update Count     : 2
+## Last Modified On : Wed Jan 13 16:29:03 2016
+## Update Count     : 3
 ###############################################################################
 
-SRC += InitTweak/RemoveInit.cc
-
+SRC += InitTweak/RemoveInit.cc \
+	InitTweak/FixInit.cc
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/Makefile.in	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -124,4 +124,5 @@
 	GenPoly/cfa_cpp-DeclMutator.$(OBJEXT) \
 	InitTweak/cfa_cpp-RemoveInit.$(OBJEXT) \
+	InitTweak/cfa_cpp-FixInit.$(OBJEXT) \
 	Parser/cfa_cpp-parser.$(OBJEXT) Parser/cfa_cpp-lex.$(OBJEXT) \
 	Parser/cfa_cpp-TypedefTable.$(OBJEXT) \
@@ -346,6 +347,6 @@
 	GenPoly/CopyParams.cc GenPoly/FindFunction.cc \
 	GenPoly/InstantiateGeneric.cc GenPoly/DeclMutator.cc \
-	InitTweak/RemoveInit.cc Parser/parser.yy Parser/lex.ll \
-	Parser/TypedefTable.cc Parser/ParseNode.cc \
+	InitTweak/RemoveInit.cc InitTweak/FixInit.cc Parser/parser.yy \
+	Parser/lex.ll Parser/TypedefTable.cc Parser/ParseNode.cc \
 	Parser/DeclarationNode.cc Parser/ExpressionNode.cc \
 	Parser/StatementNode.cc Parser/InitializerNode.cc \
@@ -562,4 +563,6 @@
 	@: > InitTweak/$(DEPDIR)/$(am__dirstamp)
 InitTweak/cfa_cpp-RemoveInit.$(OBJEXT): InitTweak/$(am__dirstamp) \
+	InitTweak/$(DEPDIR)/$(am__dirstamp)
+InitTweak/cfa_cpp-FixInit.$(OBJEXT): InitTweak/$(am__dirstamp) \
 	InitTweak/$(DEPDIR)/$(am__dirstamp)
 Parser/parser.h: Parser/parser.cc
@@ -783,4 +786,5 @@
 	-rm -f GenPoly/cfa_cpp-ScrubTyVars.$(OBJEXT)
 	-rm -f GenPoly/cfa_cpp-Specialize.$(OBJEXT)
+	-rm -f InitTweak/cfa_cpp-FixInit.$(OBJEXT)
 	-rm -f InitTweak/cfa_cpp-RemoveInit.$(OBJEXT)
 	-rm -f Parser/cfa_cpp-DeclarationNode.$(OBJEXT)
@@ -890,4 +894,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/cfa_cpp-ScrubTyVars.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@GenPoly/$(DEPDIR)/cfa_cpp-Specialize.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/cfa_cpp-FixInit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@InitTweak/$(DEPDIR)/cfa_cpp-RemoveInit.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Parser/$(DEPDIR)/cfa_cpp-DeclarationNode.Po@am__quote@
@@ -1388,4 +1393,18 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/cfa_cpp-RemoveInit.obj `if test -f 'InitTweak/RemoveInit.cc'; then $(CYGPATH_W) 'InitTweak/RemoveInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/RemoveInit.cc'; fi`
 
+InitTweak/cfa_cpp-FixInit.o: InitTweak/FixInit.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/cfa_cpp-FixInit.o -MD -MP -MF InitTweak/$(DEPDIR)/cfa_cpp-FixInit.Tpo -c -o InitTweak/cfa_cpp-FixInit.o `test -f 'InitTweak/FixInit.cc' || echo '$(srcdir)/'`InitTweak/FixInit.cc
+@am__fastdepCXX_TRUE@	$(am__mv) InitTweak/$(DEPDIR)/cfa_cpp-FixInit.Tpo InitTweak/$(DEPDIR)/cfa_cpp-FixInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='InitTweak/FixInit.cc' object='InitTweak/cfa_cpp-FixInit.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/cfa_cpp-FixInit.o `test -f 'InitTweak/FixInit.cc' || echo '$(srcdir)/'`InitTweak/FixInit.cc
+
+InitTweak/cfa_cpp-FixInit.obj: InitTweak/FixInit.cc
+@am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT InitTweak/cfa_cpp-FixInit.obj -MD -MP -MF InitTweak/$(DEPDIR)/cfa_cpp-FixInit.Tpo -c -o InitTweak/cfa_cpp-FixInit.obj `if test -f 'InitTweak/FixInit.cc'; then $(CYGPATH_W) 'InitTweak/FixInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixInit.cc'; fi`
+@am__fastdepCXX_TRUE@	$(am__mv) InitTweak/$(DEPDIR)/cfa_cpp-FixInit.Tpo InitTweak/$(DEPDIR)/cfa_cpp-FixInit.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='InitTweak/FixInit.cc' object='InitTweak/cfa_cpp-FixInit.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o InitTweak/cfa_cpp-FixInit.obj `if test -f 'InitTweak/FixInit.cc'; then $(CYGPATH_W) 'InitTweak/FixInit.cc'; else $(CYGPATH_W) '$(srcdir)/InitTweak/FixInit.cc'; fi`
+
 Parser/cfa_cpp-parser.o: Parser/parser.cc
 @am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Parser/cfa_cpp-parser.o -MD -MP -MF Parser/$(DEPDIR)/cfa_cpp-parser.Tpo -c -o Parser/cfa_cpp-parser.o `test -f 'Parser/parser.cc' || echo '$(srcdir)/'`Parser/parser.cc
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/ResolvExpr/Resolver.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Resolver.cc -- 
+// Resolver.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 12:17:01 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 24 17:33:54 2015
-// Update Count     : 178
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 16:23:51 2016
+// Update Count     : 186
 //
 
@@ -33,5 +33,5 @@
 	  public:
 		Resolver() : SymTab::Indexer( false ), switchType( 0 ) {}
-  
+
 		virtual void visit( FunctionDecl *functionDecl );
 		virtual void visit( ObjectDecl *functionDecl );
@@ -54,4 +54,5 @@
 		virtual void visit( SingleInit *singleInit );
 		virtual void visit( ListInit *listInit );
+		virtual void visit( ConstructorInit *ctorInit );
 	  private:
   	typedef std::list< Initializer * >::iterator InitIterator;
@@ -95,5 +96,5 @@
 			return newExpr;
 		}
-  
+
 		Expression *findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
 			TypeEnvironment env;
@@ -126,5 +127,5 @@
 			} // if
 		}
-  
+
 		Expression *findIntegralExpression( Expression *untyped, const SymTab::Indexer &indexer ) {
 			TypeEnvironment env;
@@ -159,7 +160,7 @@
 			return newExpr;
 		}
-  
-	}
-  
+
+	}
+
 	void Resolver::visit( ObjectDecl *objectDecl ) {
 		Type *new_type = resolveTypeof( objectDecl->get_type(), *this );
@@ -251,5 +252,5 @@
 			forStmt->set_condition( newExpr );
 		} // if
-		
+
 		if ( forStmt->get_increment() ) {
 			Expression * newExpr = findVoidExpression( forStmt->get_increment(), *this );
@@ -265,5 +266,5 @@
 		delete switchStmt->get_condition();
 		switchStmt->set_condition( newExpr );
-  
+
 		visitor.Visitor::visit( switchStmt );
 	}
@@ -307,5 +308,5 @@
 	bool isCharType( T t ) {
 		if ( BasicType * bt = dynamic_cast< BasicType * >( t ) ) {
-			return bt->get_kind() == BasicType::Char || bt->get_kind() == BasicType::SignedChar || 
+			return bt->get_kind() == BasicType::Char || bt->get_kind() == BasicType::SignedChar ||
 				bt->get_kind() == BasicType::UnsignedChar;
 		}
@@ -319,5 +320,5 @@
 				string n = ne->get_name();
 				if (n == "0") {
-					initContext = new BasicType(Type::Qualifiers(), 
+					initContext = new BasicType(Type::Qualifiers(),
 												BasicType::SignedInt);
 				} else {
@@ -325,5 +326,5 @@
 					initContext = decl->get_type();
 				}
-			} else if (ConstantExpr * e = 
+			} else if (ConstantExpr * e =
 					   dynamic_cast<ConstantExpr*>(singleInit->get_value())) {
 				Constant *c = e->get_constant();
@@ -349,5 +350,5 @@
 							singleInit->set_value( ce->get_arg() );
 							ce->set_arg( NULL );
-							delete ce;									
+							delete ce;
 						}
 					}
@@ -465,4 +466,28 @@
 #endif
 	}
+
+	void Resolver::visit( ConstructorInit *ctorInit ) {
+		TypeEnvironment env;
+		AlternativeFinder finder( *this, env );
+		finder.find( ctorInit->get_ctor() );
+		if ( finder.get_alternatives().size() == 0 ) {
+			// could not find valid constructor
+			delete ctorInit->get_ctor();
+			ctorInit->set_ctor( NULL );
+
+			maybeAccept( ctorInit->get_init(), *this );
+		} else if ( finder.get_alternatives().size() == 1 ) {
+			// found a constructor - can get rid of C-style initializer
+			Alternative &choice = finder.get_alternatives().front();
+			Expression *newExpr = choice.expr->clone();
+			finishExpr( newExpr, choice.env );
+			ctorInit->set_ctor( newExpr );
+			delete ctorInit->get_init();
+			ctorInit->set_init( NULL );
+		} else {
+			// too many constructors found
+			assert(false);
+		}
+	}
 } // namespace ResolvExpr
 
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/Declaration.h	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Thu Jan 07 14:48:44 2016
-// Update Count     : 34
+// Last Modified On : Wed Jan 13 16:11:49 2016
+// Update Count     : 36
 //
 
@@ -91,6 +91,4 @@
 	Expression *get_bitfieldWidth() const { return bitfieldWidth; }
 	void set_bitfieldWidth( Expression *newValue ) { bitfieldWidth = newValue; }
-	ExprStmt * get_ctor() const { return ctor; }
-	void set_ctor( ExprStmt * newValue ) { ctor = newValue; }
 
 	virtual ObjectDecl *clone() const { return new ObjectDecl( *this ); }
@@ -103,5 +101,4 @@
 	Initializer *init;
 	Expression *bitfieldWidth;
-	ExprStmt * ctor;
 };
 
Index: src/SynTree/Initializer.cc
===================================================================
--- src/SynTree/Initializer.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/Initializer.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Thu Jan 07 15:00:18 2016
-// Update Count     : 23
+// Last Modified On : Wed Jan 13 15:31:45 2016
+// Update Count     : 28
 //
 
@@ -79,4 +79,30 @@
 		(*i)->print( os, indent + 2 );
 }
+
+
+ConstructorInit::ConstructorInit( Expression * ctor, Initializer * init ) : Initializer( true ), ctor( ctor ), init( init ) {}
+ConstructorInit::~ConstructorInit() {
+	delete ctor;
+	delete init;
+}
+
+ConstructorInit *ConstructorInit::clone() const {
+	return new ConstructorInit( *this );
+}
+
+void ConstructorInit::print( std::ostream &os, int indent ) {
+	os << std::endl << std::string(indent, ' ') << "Constructor initializer: ";
+	if ( ctor ) {
+		os << " initially constructed with ";
+		ctor->print( os, indent+2 );
+	} // if
+
+	if ( init ) {
+		os << " with fallback C-style initializer: ";
+		init->print( os, indent+2 );
+	}
+}
+
+
 // Local Variables: //
 // tab-width: 4 //
Index: src/SynTree/Initializer.h
===================================================================
--- src/SynTree/Initializer.h	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/Initializer.h	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Thu Jan 07 13:33:20 2016
-// Update Count     : 5
+// Last Modified On : Wed Jan 13 15:29:53 2016
+// Update Count     : 17
 //
 
@@ -103,4 +103,28 @@
 };
 
+// ConstructorInit represents an initializer that is either a constructor expression or
+// a C-style initializer.
+class ConstructorInit : public Initializer {
+  public:
+	ConstructorInit( Expression * ctor, Initializer * init );
+	virtual ~ConstructorInit();
+
+	void set_ctor( Expression * newValue ) { ctor = newValue; }
+	Expression * get_ctor() const { return ctor; }
+	void set_init( Initializer * newValue ) { init = newValue; }
+	Initializer * get_init() const { return init; }
+
+	virtual ConstructorInit *clone() const;
+	virtual void accept( Visitor &v ) { v.visit( this ); }
+	virtual Initializer *acceptMutator( Mutator &m ) { return m.mutate( this ); }
+	virtual void print( std::ostream &os, int indent = 0 );
+
+  private:
+	Expression * ctor;
+	// C-style initializer made up of SingleInit and ListInit nodes to use as a fallback
+	// if an appropriate constructor definition is not found by the resolver
+	Initializer * init;
+};
+
 #endif // INITIALIZER_H
 
Index: src/SynTree/Mutator.cc
===================================================================
--- src/SynTree/Mutator.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/Mutator.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Mutator.cc -- 
+// Mutator.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jul 25 19:21:33 2015
-// Update Count     : 11
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 15:32:29 2016
+// Update Count     : 15
 //
 
@@ -419,4 +419,10 @@
 }
 
+Initializer *Mutator::mutate( ConstructorInit *ctorInit ) {
+	ctorInit->set_ctor( maybeMutate( ctorInit->get_ctor(), *this ) );
+	ctorInit->set_init( maybeMutate( ctorInit->get_init(), *this ) );
+	return ctorInit;
+}
+
 Subrange *Mutator::mutate( Subrange *subrange ) {
 	return subrange;
Index: src/SynTree/Mutator.h
===================================================================
--- src/SynTree/Mutator.h	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/Mutator.h	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Mutator.h -- 
+// Mutator.h --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Nov 19 22:26:16 2015
-// Update Count     : 8
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 15:24:26 2016
+// Update Count     : 9
 //
 #include <cassert>
@@ -62,5 +62,5 @@
 	virtual Expression* mutate( MemberExpr *memberExpr );
 	virtual Expression* mutate( VariableExpr *variableExpr );
-	virtual Expression* mutate( ConstantExpr *constantExpr ); 
+	virtual Expression* mutate( ConstantExpr *constantExpr );
 	virtual Expression* mutate( SizeofExpr *sizeofExpr );
 	virtual Expression* mutate( AlignofExpr *alignofExpr );
@@ -91,4 +91,5 @@
 	virtual Initializer* mutate( SingleInit *singleInit );
 	virtual Initializer* mutate( ListInit *listInit );
+	virtual Initializer* mutate( ConstructorInit *ctorInit );
 
 	virtual Subrange *mutate( Subrange *subrange );
Index: src/SynTree/ObjectDecl.cc
===================================================================
--- src/SynTree/ObjectDecl.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/ObjectDecl.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri Jan 08 15:29:10 2016
-// Update Count     : 27
+// Last Modified On : Wed Jan 13 16:11:19 2016
+// Update Count     : 29
 //
 
@@ -25,9 +25,8 @@
 	set_isInline( isInline );
 	set_isNoreturn( isNoreturn );
-	set_ctor( NULL );
 }
 
 ObjectDecl::ObjectDecl( const ObjectDecl &other )
-	: Parent( other ), type( maybeClone( other.type ) ), init( maybeClone( other.init ) ), bitfieldWidth( maybeClone( other.bitfieldWidth ) ), ctor( maybeClone( other.ctor ) ) {
+	: Parent( other ), type( maybeClone( other.type ) ), init( maybeClone( other.init ) ), bitfieldWidth( maybeClone( other.bitfieldWidth ) ) {
 }
 
@@ -36,5 +35,4 @@
 	delete init;
 	delete bitfieldWidth;
-	delete ctor;
 }
 
@@ -67,9 +65,4 @@
 		os << " with bitfield width ";
 		bitfieldWidth->print( os );
-	} // if
-
-	if ( ctor ) {
-		os << " initially constructed with ";
-		ctor->print( os, indent );
 	} // if
 }
Index: src/SynTree/SynTree.h
===================================================================
--- src/SynTree/SynTree.h	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/SynTree.h	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// SynTree.h -- 
+// SynTree.h --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Jul 23 23:25:04 2015
-// Update Count     : 3
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 15:28:41 2016
+// Update Count     : 4
 //
 
@@ -99,4 +99,5 @@
 class SingleInit;
 class ListInit;
+class ConstructorInit;
 
 class Subrange;
Index: src/SynTree/Visitor.cc
===================================================================
--- src/SynTree/Visitor.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/Visitor.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Visitor.cc -- 
+// Visitor.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 24 16:11:05 2015
-// Update Count     : 15
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 15:27:23 2016
+// Update Count     : 18
 //
 
@@ -353,4 +353,9 @@
 }
 
+void Visitor::visit( ConstructorInit *ctorInit ) {
+	maybeAccept( ctorInit->get_ctor(), *this );
+	maybeAccept( ctorInit->get_init(), *this );
+}
+
 void Visitor::visit( Subrange *subrange ) {}
 
Index: src/SynTree/Visitor.h
===================================================================
--- src/SynTree/Visitor.h	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/SynTree/Visitor.h	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Visitor.h -- 
+// Visitor.h --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Jul 23 23:22:23 2015
-// Update Count     : 4
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 15:24:05 2016
+// Update Count     : 5
 //
 
@@ -62,5 +62,5 @@
 	virtual void visit( MemberExpr *memberExpr );
 	virtual void visit( VariableExpr *variableExpr );
-	virtual void visit( ConstantExpr *constantExpr ); 
+	virtual void visit( ConstantExpr *constantExpr );
 	virtual void visit( SizeofExpr *sizeofExpr );
 	virtual void visit( AlignofExpr *alignofExpr );
@@ -91,4 +91,5 @@
 	virtual void visit( SingleInit *singleInit );
 	virtual void visit( ListInit *listInit );
+	virtual void visit( ConstructorInit *ctorInit );
 
 	virtual void visit( Subrange *subrange );
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 02c7d048c23eb98f2aef98ff111715a540cfb3fe)
+++ src/main.cc	(revision 71f4e4f59e25d1ae31af19227f4d2a8a9365bac7)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// main.cc -- 
+// main.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Fri May 15 23:12:02 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Dec 17 12:59:06 2015
-// Update Count     : 179
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Jan 13 16:47:25 2016
+// Update Count     : 181
 //
 
@@ -42,4 +42,5 @@
 #include "InitTweak/Mutate.h"
 #include "InitTweak/RemoveInit.h"
+#include "InitTweak/FixInit.h"
 //#include "Explain/GenProlog.h"
 //#include "Try/Visit.h"
@@ -99,5 +100,5 @@
 
 	opterr = 0;											// prevent getopt from printing error messages
-	
+
 	int c;
 	while ( (c = getopt_long( argc, argv, "abefglnpqrsvyzD:", long_opts, &long_index )) != -1 ) {
@@ -182,5 +183,5 @@
 			output = new ofstream( argv[ optind ] );
 		} // if
-	
+
 		Parser::get_parser().set_debug( grammarp );
 
@@ -203,11 +204,11 @@
 					exit( 1 );
 				} // if
-		    
+
 				parse( prelude, LinkageSpec::Intrinsic );
 			} // if
 		} // if
 
-		parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );	
-  
+		parse( input, libcfap ? LinkageSpec::Intrinsic : LinkageSpec::Cforall, grammarp );
+
 		if ( parsep ) {
 			Parser::get_parser().get_parseTree()->printList( std::cout );
@@ -244,5 +245,5 @@
 		OPTPRINT( "mutate" )
 		ControlStruct::mutate( translationUnit );
-		OPTPRINT( "fixNames" ) 
+		OPTPRINT( "fixNames" )
 		CodeGen::fixNames( translationUnit );
 		OPTPRINT( "tweak" )
@@ -264,4 +265,7 @@
 			dump( translationUnit );
 		}
+
+		// fix ObjectDecl - replaces ConstructorInit nodes
+		InitTweak::fix( translationUnit );
 
 		OPTPRINT( "instantiateGeneric" )
@@ -331,5 +335,5 @@
 	std::list< Declaration * > decls;
 	if ( noprotop ) {
-		filter( translationUnit.begin(), translationUnit.end(), 
+		filter( translationUnit.begin(), translationUnit.end(),
 				std::back_inserter( decls ), notPrelude );
 	} else {
