Index: src/SynTree/AddressExpr.cc
===================================================================
--- src/SynTree/AddressExpr.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/AddressExpr.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// AddressExpr.cc -- 
+// AddressExpr.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 23:54:44 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue May 19 16:52:51 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue Apr 26 12:35:13 2016
 // Update Count     : 6
 //
@@ -32,7 +32,8 @@
 
 void AddressExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Address of:" << std::endl;
+	os << "Address of:" << std::endl;
 	if ( arg ) {
-		arg->print( os, indent+2 );
+		os << std::string( indent+2, ' ' );
+    arg->print( os, indent+2 );
 	} // if
 }
Index: src/SynTree/ApplicationExpr.cc
===================================================================
--- src/SynTree/ApplicationExpr.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/ApplicationExpr.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// ApplicationExpr.cc.cc -- 
+// ApplicationExpr.cc.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 07:54:17 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue Apr 26 12:41:06 2016
 // Update Count     : 4
 //
@@ -47,5 +47,5 @@
 	FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() );
 	assert( function );
-	
+
 	for ( std::list< DeclarationWithType* >::const_iterator i = function->get_returnVals().begin(); i != function->get_returnVals().end(); ++i ) {
 		get_results().push_back( (*i)->get_type()->clone() );
@@ -64,5 +64,5 @@
 
 void ApplicationExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Application of" << std::endl;
+	os << "Application of" << std::endl << std::string(indent, ' ');
 	function->print( os, indent+2 );
 	if ( ! args.empty() ) {
Index: src/SynTree/CommaExpr.cc
===================================================================
--- src/SynTree/CommaExpr.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/CommaExpr.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// CommaExpr.cc -- 
+// CommaExpr.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 08:09:58 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Mon May 02 15:19:44 2016
 // Update Count     : 1
 //
@@ -20,5 +20,11 @@
 CommaExpr::CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname )
 		: Expression( _aname ), arg1( arg1 ), arg2( arg2 ) {
+	// xxx - result of a comma expression is never an lvalue, so should set lvalue
+	// to false on all result types. Actually doing this causes some strange things
+	// to happen in later passes (particularly, Specialize, Lvalue, and Box). This needs to be looked into.
 	cloneAll( arg2->get_results(), get_results() );
+	// for ( Type *& type : get_results() ) {
+	// 	type->set_isLvalue( false );
+	// }
 }
 
@@ -33,7 +39,9 @@
 
 void CommaExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Comma Expression:" << std::endl;
+	os << "Comma Expression:" << std::endl;
+	os << std::string( indent+2, ' ' );
 	arg1->print( os, indent+2 );
 	os << std::endl;
+	os << std::string( indent+2, ' ' );
 	arg2->print( os, indent+2 );
 	Expression::print( os, indent );
Index: src/SynTree/CompoundStmt.cc
===================================================================
--- src/SynTree/CompoundStmt.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/CompoundStmt.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// XXX.cc -- 
+// XXX.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Jun 23 11:37:49 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Mon May 02 15:19:17 2016
 // Update Count     : 3
 //
@@ -18,7 +18,26 @@
 #include <algorithm>
 #include <functional>
+#include "Expression.h"
+#include "Declaration.h"
 
 using std::string;
 using std::endl;
+
+class VarExprReplacer : public Visitor {
+public:
+  typedef std::map< DeclarationWithType *, DeclarationWithType * > DeclMap;
+private:
+  const DeclMap & declMap;
+public:
+  VarExprReplacer( const DeclMap & declMap ) : declMap( declMap ) {}
+
+  // replace variable with new node from decl map
+  virtual void visit( VariableExpr * varExpr ) {
+    if ( declMap.count( varExpr->get_var() ) ) {
+      varExpr->set_var( declMap.at( varExpr->get_var() ) );
+    }
+  }
+};
+
 
 CompoundStmt::CompoundStmt( std::list<Label> labels ) : Statement( labels ) {
@@ -27,4 +46,35 @@
 CompoundStmt::CompoundStmt( const CompoundStmt &other ) : Statement( other ) {
 	cloneAll( other.kids, kids );
+
+  // when cloning a compound statement, we may end up cloning declarations which
+  // are referred to by VariableExprs throughout the block. Cloning a VariableExpr
+  // does a shallow copy, so the VariableExpr will end up pointing to the original
+  // declaration. If the original declaration is deleted, e.g. because the original
+  // CompoundStmt is deleted, then we have a dangling pointer. To avoid this case,
+  // find all DeclarationWithType nodes (since a VariableExpr must point to a
+  // DeclarationWithType) in the original CompoundStmt and map them to the cloned
+  // node in the new CompoundStmt ('this'), then replace the Declarations referred to
+  // by each VariableExpr according to the constructed map. Note that only the declarations
+  // in the current level are collected into the map, because child CompoundStmts will
+  // recursively execute this routine. There may be more efficient ways of doing
+  // this.
+  VarExprReplacer::DeclMap declMap;
+  std::list< Statement * >::const_iterator origit = other.kids.begin();
+  for ( Statement * s : kids ) {
+    assert( origit != other.kids.end() );
+    if ( DeclStmt * declStmt = dynamic_cast< DeclStmt * >( s ) ) {
+      DeclStmt * origDeclStmt = dynamic_cast< DeclStmt * >( *origit );
+      assert( origDeclStmt );
+      if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * > ( declStmt->get_decl() ) ) {
+        DeclarationWithType * origdwt = dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
+        assert( origdwt );
+        declMap[ origdwt ] = dwt;
+      }
+    }
+  }
+  if ( ! declMap.empty() ) {
+    VarExprReplacer replacer( declMap );
+    accept( replacer );
+  }
 }
 
@@ -34,5 +84,5 @@
 
 void CompoundStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "CompoundStmt" << endl ;
+	os << "CompoundStmt" << endl ;
 	printAll( kids, os, indent + 2 );
 }
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Declaration.h	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri May 06 15:39:02 2016
+// Last Modified On : Fri May 06 16:26:12 2016
 // Update Count     : 33
 //
@@ -22,4 +22,5 @@
 #include "Parser/LinkageSpec.h"
 #include "Parser/ParseNode.h"
+#include <string>
 
 class Declaration {
@@ -67,4 +68,9 @@
 	void set_mangleName( std::string newValue ) { mangleName = newValue; }
 
+	std::string get_scopedMangleName() const { return mangleName + "_" + std::to_string(scopeLevel); }
+
+	int get_scopeLevel() const { return scopeLevel; }
+	void set_scopeLevel( int newValue ) { scopeLevel = newValue; }
+
 	virtual DeclarationWithType *clone() const = 0;
 	virtual DeclarationWithType *acceptMutator( Mutator &m ) = 0;
@@ -75,4 +81,7 @@
 	// this represents the type with all types and typedefs expanded it is generated by SymTab::Validate::Pass2
 	std::string mangleName;
+	// need to remember the scope level at which the variable was declared, so that
+	// shadowed identifiers can be accessed
+	int scopeLevel = 0;
 };
 
Index: src/SynTree/DeclarationWithType.cc
===================================================================
--- src/SynTree/DeclarationWithType.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/DeclarationWithType.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// DeclarationWithType.cc -- 
+// DeclarationWithType.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sat Jun 13 08:08:07 2015
+// Last Modified By : Rob Schluntz
+// Last Modified On : Mon Apr 11 15:35:27 2016
 // Update Count     : 3
 //
@@ -23,5 +23,5 @@
 
 DeclarationWithType::DeclarationWithType( const DeclarationWithType &other )
-		: Declaration( other ), mangleName( other.mangleName ) {
+		: Declaration( other ), mangleName( other.mangleName ), scopeLevel( other.scopeLevel ) {
 }
 
Index: src/SynTree/Expression.cc
===================================================================
--- src/SynTree/Expression.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Expression.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -9,6 +9,6 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Apr  8 17:16:23 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed May 04 12:17:51 2016
 // Update Count     : 40
 //
@@ -72,5 +72,5 @@
 
 void ConstantExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "constant expression " ;
+	os << "constant expression " ;
 	constant.print( os );
 	Expression::print( os, indent );
@@ -79,4 +79,6 @@
 
 VariableExpr::VariableExpr( DeclarationWithType *_var, Expression *_aname ) : Expression( _aname ), var( _var ) {
+	assert( var );
+	assert( var->get_type() );
 	add_result( var->get_type()->clone() );
 	for ( std::list< Type* >::iterator i = get_results().begin(); i != get_results().end(); ++i ) {
@@ -93,5 +95,5 @@
 
 void VariableExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Variable Expression: ";
+	os << "Variable Expression: ";
 
 	Declaration *decl = get_var();
@@ -122,5 +124,5 @@
 
 void SizeofExpr::print( std::ostream &os, int indent) const {
-	os << std::string( indent, ' ' ) << "Sizeof Expression on: ";
+	os << "Sizeof Expression on: ";
 
 	if (isType)
@@ -295,5 +297,5 @@
 
 void CastExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Cast of:" << std::endl;
+	os << "Cast of:" << std::endl << std::string( indent+2, ' ' );
 	arg->print(os, indent+2);
 	os << std::endl << std::string( indent, ' ' ) << "to:" << std::endl;
@@ -318,9 +320,12 @@
 
 void UntypedMemberExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Member Expression, with field: " << get_member();
+	os << "Untyped Member Expression, with field: " << get_member();
 
 	Expression *agg = get_aggregate();
-	os << std::string( indent, ' ' ) << "from aggregate: ";
-	if (agg != 0) agg->print(os, indent + 2);
+	os << ", from aggregate: ";
+	if (agg != 0) {
+		agg->print(os, indent + 2);
+	}
+	os << std::string( indent+2, ' ' );
 	Expression::print( os, indent );
 }
@@ -345,5 +350,5 @@
 
 void MemberExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Member Expression, with field: " << std::endl;
+	os << "Member Expression, with field: " << std::endl;
 
 	assert( member );
@@ -354,5 +359,8 @@
 	Expression *agg = get_aggregate();
 	os << std::string( indent, ' ' ) << "from aggregate: " << std::endl;
-	if (agg != 0) agg->print(os, indent + 2);
+	if (agg != 0) {
+		agg->print(os, indent + 2);
+	}
+	os << std::string( indent+2, ' ' );
 	Expression::print( os, indent );
 }
@@ -372,8 +380,9 @@
 
 void UntypedExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Applying untyped: " << std::endl;
+	os << "Applying untyped: " << std::endl;
+	os << std::string( indent+4, ' ' );
 	function->print(os, indent + 4);
 	os << std::string( indent, ' ' ) << "...to: " << std::endl;
-	printArgs(os, indent + 4);
+	printAll(args, os, indent + 4);
 	Expression::print( os, indent );
 }
@@ -381,6 +390,8 @@
 void UntypedExpr::printArgs( std::ostream &os, int indent ) const {
 	std::list<Expression *>::const_iterator i;
-	for (i = args.begin(); i != args.end(); i++)
+	for (i = args.begin(); i != args.end(); i++) {
+		os << std::string(indent, ' ' );
 		(*i)->print(os, indent);
+	}
 }
 
@@ -393,5 +404,5 @@
 
 void NameExpr::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << "Name: " << get_name() << std::endl;
+	os << "Name: " << get_name() << std::endl;
 	Expression::print( os, indent );
 }
@@ -454,4 +465,34 @@
 }
 
+
+ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( ApplicationExpr * callExpr ) : callExpr( callExpr ) {
+	assert( callExpr );
+	cloneAll( callExpr->get_results(), results );
+}
+
+ImplicitCopyCtorExpr::ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other ) : Expression( other ), callExpr( maybeClone( other.callExpr ) ) {
+	cloneAll( other.tempDecls, tempDecls );
+	cloneAll( other.returnDecls, returnDecls );
+	cloneAll( other.dtors, dtors );
+}
+
+ImplicitCopyCtorExpr::~ImplicitCopyCtorExpr() {
+	delete callExpr;
+	deleteAll( tempDecls );
+	deleteAll( returnDecls );
+	deleteAll( dtors );
+}
+
+void ImplicitCopyCtorExpr::print( std::ostream &os, int indent ) const {
+	os << std::string( indent, ' ' ) <<  "Implicit Copy Constructor Expression: " << std::endl;
+	assert( callExpr );
+	callExpr->print( os, indent + 2 );
+	os << std::endl << std::string( indent, ' ' ) << "with temporaries:" << std::endl;
+	printAll(tempDecls, os, indent+2);
+	os << std::endl << std::string( indent, ' ' ) << "with return temporaries:" << std::endl;
+	printAll(returnDecls, os, indent+2);
+	Expression::print( os, indent );
+}
+
 UntypedValofExpr::UntypedValofExpr( const UntypedValofExpr & other ) : Expression( other ), body ( maybeClone( other.body ) ) {}
 
Index: src/SynTree/Expression.h
===================================================================
--- src/SynTree/Expression.h	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Expression.h	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -9,6 +9,6 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Apr  8 17:18:06 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Apr 27 17:06:49 2016
 // Update Count     : 21
 //
@@ -22,4 +22,5 @@
 #include "Mutator.h"
 #include "Constant.h"
+#include "Common/UniqueName.h"
 
 /// Expression is the root type for all expressions
@@ -559,4 +560,35 @@
 };
 
+/// ImplicitCopyCtorExpr represents the application of a function to a set of parameters,
+/// along with a set of copy constructor calls, one for each argument.
+class ImplicitCopyCtorExpr : public Expression {
+public:
+	ImplicitCopyCtorExpr( ApplicationExpr * callExpr );
+	ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other );
+	virtual ~ImplicitCopyCtorExpr();
+
+	ApplicationExpr *get_callExpr() const { return callExpr; }
+	void set_callExpr( ApplicationExpr *newValue ) { callExpr = newValue; }
+
+	std::list< ObjectDecl * > & get_tempDecls() { return tempDecls; }
+	void set_tempDecls( std::list< ObjectDecl * > newValue ) { tempDecls = newValue; }
+
+	std::list< ObjectDecl * > & get_returnDecls() { return returnDecls; }
+	void set_returnDecls( std::list< ObjectDecl * > newValue ) { returnDecls = newValue; }
+
+	std::list< Expression * > & get_dtors() { return dtors; }
+	void set_dtors( std::list< Expression * > newValue ) { dtors = newValue; }
+
+	virtual ImplicitCopyCtorExpr *clone() const { return new ImplicitCopyCtorExpr( *this ); }
+	virtual void accept( Visitor &v ) { v.visit( this ); }
+	virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
+	virtual void print( std::ostream &os, int indent = 0 ) const;
+  private:
+	ApplicationExpr * callExpr;
+	std::list< ObjectDecl * > tempDecls;
+	std::list< ObjectDecl * > returnDecls;
+	std::list< Expression * > dtors;
+};
+
 /// ValofExpr represents a GCC 'lambda expression'
 class UntypedValofExpr : public Expression {
Index: src/SynTree/FunctionDecl.cc
===================================================================
--- src/SynTree/FunctionDecl.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/FunctionDecl.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri May 06 15:41:05 2016
+// Last Modified On : Fri May 06 15:59:48 2016
 // Update Count     : 19
 //
@@ -100,4 +100,5 @@
 	if ( statements ) {
 		os << string( indent + 2, ' ' ) << "with body " << endl;
+		os << string( indent + 4, ' ' );
 		statements->print( os, indent + 4 );
 	} // if
Index: src/SynTree/Initializer.cc
===================================================================
--- src/SynTree/Initializer.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Initializer.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,18 +5,19 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Initializer.cc -- 
+// Initializer.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Wed Aug 12 14:05:25 2015
-// Update Count     : 14
+// Last Modified On : Tue Apr 26 15:51:35 2016
+// Update Count     : 28
 //
 
 #include "Initializer.h"
 #include "Expression.h"
+#include "Statement.h"
 #include "Common/utility.h"
 
-Initializer::Initializer() {}
+Initializer::Initializer( bool maybeConstructed ) : maybeConstructed( maybeConstructed ) {}
 
 Initializer::~Initializer() {}
@@ -31,8 +32,8 @@
 void Initializer::print( std::ostream &os, int indent ) {}
 
-SingleInit::SingleInit( Expression *v, std::list< Expression *> &_designators ) : value ( v ), designators( _designators ) { 
+SingleInit::SingleInit( Expression *v, const std::list< Expression *> &_designators, bool maybeConstructed ) : Initializer( maybeConstructed ), value ( v ), designators( _designators ) {
 }
 
-SingleInit::SingleInit( const SingleInit &other ) : value ( other.value ) {
+SingleInit::SingleInit( const SingleInit &other ) : Initializer(other), value ( maybeClone( other.value ) ) {
 	cloneAll(other.designators, designators );
 }
@@ -44,4 +45,5 @@
 void SingleInit::print( std::ostream &os, int indent ) {
 	os << std::endl << std::string(indent, ' ' ) << "Simple Initializer: " << std::endl;
+	os << std::string(indent+4, ' ' );
 	value->print( os, indent+4 );
 
@@ -54,6 +56,6 @@
 }
 
-ListInit::ListInit( std::list<Initializer*> &_initializers, std::list<Expression *> &_designators )
-	: initializers( _initializers ), designators( _designators ) {
+ListInit::ListInit( const std::list<Initializer*> &_initializers, const std::list<Expression *> &_designators, bool maybeConstructed )
+	: Initializer( maybeConstructed), initializers( _initializers ), designators( _designators ) {
 }
 
@@ -65,18 +67,56 @@
 
 void ListInit::print( std::ostream &os, int indent ) {
-	os << std::endl << std::string(indent, ' ') << "Compound initializer:  "; 
+	os << std::endl << std::string(indent, ' ') << "Compound initializer:  ";
 	if ( ! designators.empty() ) {
 		os << std::string(indent + 2, ' ' ) << "designated by: [";
 		for ( std::list < Expression * >::iterator i = designators.begin();
 			  i != designators.end(); i++ ) {
-			( *i )->print(os, indent + 4 ); 
+			( *i )->print(os, indent + 4 );
 		} // for
-	
+
 		os << std::string(indent + 2, ' ' ) << "]";
 	} // if
 
-	for ( std::list<Initializer *>::iterator i = initializers.begin(); i != initializers.end(); i++ ) 
+	for ( std::list<Initializer *>::iterator i = initializers.begin(); i != initializers.end(); i++ )
 		(*i)->print( os, indent + 2 );
 }
+
+
+ConstructorInit::ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init ) : Initializer( true ), ctor( ctor ), dtor( dtor ), 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: " << std::endl;
+	if ( ctor ) {
+		os << std::string(indent+2, ' ');
+		os << "initially constructed with ";
+		ctor->print( os, indent+4 );
+	} // if
+
+	if ( dtor ) {
+		os << std::string(indent+2, ' ');
+		os << "destructed with ";
+		dtor->print( os, indent+4 );
+	}
+
+	if ( init ) {
+		os << std::string(indent+2, ' ');
+		os << "with fallback C-style initializer: ";
+		init->print( os, indent+4 );
+	}
+}
+
+std::ostream & operator<<( std::ostream & out, Initializer * init ) {
+	init->print( out );
+	return out;
+}
+
 // Local Variables: //
 // tab-width: 4 //
Index: src/SynTree/Initializer.h
===================================================================
--- src/SynTree/Initializer.h	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Initializer.h	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Initializer.h -- 
+// Initializer.h --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Mon May 18 09:03:48 2015
-// Update Count     : 1
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue Apr 12 13:49:13 2016
+// Update Count     : 19
 //
 
@@ -27,5 +27,5 @@
   public:
 	//	Initializer( std::string _name = std::string(""), int _pos = 0 );
-	Initializer( );
+	Initializer( bool maybeConstructed );
 	virtual ~Initializer();
 
@@ -43,4 +43,6 @@
 	}
 
+	bool get_maybeConstructed() { return maybeConstructed; }
+
 	virtual Initializer *clone() const = 0;
 	virtual void accept( Visitor &v ) = 0;
@@ -50,4 +52,5 @@
 	//	std::string name;
 	//	int pos;
+	bool maybeConstructed;
 };
 
@@ -55,8 +58,8 @@
 class SingleInit : public Initializer {
   public:
-	SingleInit( Expression *value, std::list< Expression *> &designators = *(new std::list<Expression *>()) );
+	SingleInit( Expression *value, const std::list< Expression *> &designators = std::list< Expression * >(), bool maybeConstructed = false );
 	SingleInit( const SingleInit &other );
 	virtual ~SingleInit();
-	
+
 	Expression *get_value() { return value; }
 	void set_value( Expression *newValue ) { value = newValue; }
@@ -79,6 +82,6 @@
 class ListInit : public Initializer {
   public:
-	ListInit( std::list<Initializer*> &, 
-			  std::list<Expression *> &designators = *(new std::list<Expression *>()) );
+	ListInit( const std::list<Initializer*> &initializers,
+			  const std::list<Expression *> &designators = std::list< Expression * >(), bool maybeConstructed = false );
 	virtual ~ListInit();
 
@@ -100,4 +103,33 @@
 };
 
+// ConstructorInit represents an initializer that is either a constructor expression or
+// a C-style initializer.
+class ConstructorInit : public Initializer {
+  public:
+	ConstructorInit( Statement * ctor, Statement * dtor, Initializer * init );
+	virtual ~ConstructorInit();
+
+	void set_ctor( Statement * newValue ) { ctor = newValue; }
+	Statement * get_ctor() const { return ctor; }
+	void set_dtor( Statement * newValue ) { dtor = newValue; }
+	Statement * get_dtor() const { return dtor; }
+	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:
+	Statement * ctor;
+	Statement * dtor;
+	// 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;
+};
+
+std::ostream & operator<<( std::ostream & out, Initializer * init );
+
 #endif // INITIALIZER_H
 
Index: src/SynTree/Mutator.cc
===================================================================
--- src/SynTree/Mutator.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Mutator.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // 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 : Fri Apr  1 18:05:16 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Apr 27 17:07:29 2016
 // Update Count     : 16
 //
@@ -337,4 +337,11 @@
 }
 
+Expression* Mutator::mutate( ImplicitCopyCtorExpr *impCpCtorExpr ) {
+	impCpCtorExpr->set_callExpr( maybeMutate( impCpCtorExpr->get_callExpr(), *this ) );
+	mutateAll( impCpCtorExpr->get_tempDecls(), *this );
+	mutateAll( impCpCtorExpr->get_returnDecls(), *this );
+	return impCpCtorExpr;
+}
+
 Expression *Mutator::mutate( UntypedValofExpr *valofExpr ) {
 	mutateAll( valofExpr->get_results(), *this );
@@ -450,4 +457,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 af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Mutator.h	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // 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 : Fri Apr  1 17:26:56 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Thu Apr 14 15:32:00 2016
 // Update Count     : 10
 //
@@ -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 );
@@ -76,4 +76,5 @@
 	virtual Expression* mutate( TypeExpr *typeExpr );
 	virtual Expression* mutate( AsmExpr *asmExpr );
+	virtual Expression* mutate( ImplicitCopyCtorExpr *impCpCtorExpr );
 	virtual Expression* mutate( UntypedValofExpr *valofExpr );
 	virtual Expression* mutate( CompoundLiteralExpr *compLitExpr );
@@ -96,4 +97,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 af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/ObjectDecl.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,11 +5,11 @@
 // file "LICENCE" distributed with Cforall.
 //
-// ObjectDecl.cc -- 
+// ObjectDecl.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Tue Sep 29 14:13:01 2015
-// Update Count     : 18
+// Last Modified On : Wed May 04 12:18:28 2016
+// Update Count     : 30
 //
 
@@ -19,4 +19,5 @@
 #include "Expression.h"
 #include "Common/utility.h"
+#include "Statement.h"
 
 ObjectDecl::ObjectDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, Expression *bitfieldWidth, Type *type, Initializer *init, bool isInline, bool isNoreturn )
@@ -56,9 +57,12 @@
 
 	if ( init ) {
+		os << std::string(indent, ' ');
 		os << " with initializer ";
 		init->print( os, indent );
+		os << std::string(indent, ' ') << "maybeConstructed? " << init->get_maybeConstructed();
 	} // if
 
 	if ( bitfieldWidth ) {
+		os << std::string(indent, ' ');
 		os << " with bitfield width ";
 		bitfieldWidth->print( os );
@@ -69,6 +73,6 @@
 #if 0
 	if ( get_mangleName() != "") {
-		os << get_mangleName() << ": "; 
-	} else 
+		os << get_mangleName() << ": ";
+	} else
 #endif
 	if ( get_name() != "" ) {
Index: src/SynTree/Statement.cc
===================================================================
--- src/SynTree/Statement.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Statement.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Wed Dec 09 14:09:34 2015
+// Last Modified On : Thu Apr 28 13:34:32 2016
 // Update Count     : 54
 //
@@ -43,5 +43,5 @@
 
 void ExprStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "Expression Statement:" << endl;
+	os << "Expression Statement:" << endl << std::string( indent, ' ' );
 	expr->print( os, indent + 2 );
 }
@@ -110,6 +110,9 @@
 
 void ReturnStmt::print( std::ostream &os, int indent ) const {
-	os << std::string( indent, ' ' ) << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
-	if ( expr != 0 ) expr->print( os );
+	os << string ( isThrow? "Throw":"Return" ) << " Statement, returning: ";
+	if ( expr != 0 ) {
+		os << endl << string( indent+2, ' ' );
+		expr->print( os, indent + 2 );
+	}
 	os << endl;
 }
@@ -124,12 +127,16 @@
 
 void IfStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "If on condition: " << endl ;
+	os << "If on condition: " << endl ;
+	os << string( indent+4, ' ' );
 	condition->print( os, indent + 4 );
 
-	os << string( indent, ' ' ) << ".... and branches: " << endl;
-
+	os << string( indent+2, ' ' ) << "... then: " << endl;
+
+	os << string( indent+4, ' ' );
 	thenPart->print( os, indent + 4 );
 
 	if ( elsePart != 0 ) {
+		os << string( indent+2, ' ' ) << "... else: " << endl;
+		os << string( indent+4, ' ' );
 		elsePart->print( os, indent + 4 );
 	} // if
@@ -153,5 +160,5 @@
 
 void SwitchStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "Switch on condition: ";
+	os << "Switch on condition: ";
 	condition->print( os );
 	os << endl;
@@ -218,5 +225,5 @@
 
 void ChooseStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "Choose on condition: ";
+	os << "Choose on condition: ";
 	condition->print( os );
 	os << endl;
@@ -247,5 +254,5 @@
 
 void WhileStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "While on condition: " << endl ;
+	os << "While on condition: " << endl ;
 	condition->print( os, indent + 4 );
 
@@ -273,5 +280,5 @@
 
 void ForStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "Labels: {";
+	os << "Labels: {";
 	for ( std::list<Label>::const_iterator it = get_labels().begin(); it != get_labels().end(); ++it) {
 		os << *it << ",";
@@ -314,5 +321,5 @@
 
 void TryStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "Try Statement" << endl;
+	os << "Try Statement" << endl;
 	os << string( indent + 2, ' ' ) << "with block: " << endl;
 	block->print( os, indent + 4 );
@@ -378,5 +385,5 @@
 
 void NullStmt::print( std::ostream &os, int indent ) const {
-	os << string( indent, ' ' ) << "Null Statement" << endl ;
+	os << "Null Statement" << endl ;
 }
 
Index: src/SynTree/SynTree.h
===================================================================
--- src/SynTree/SynTree.h	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/SynTree.h	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // 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 : Fri Apr  1 16:47:44 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Thu Apr 14 15:31:36 2016
 // Update Count     : 5
 //
@@ -81,4 +81,5 @@
 class TypeExpr;
 class AsmExpr;
+class ImplicitCopyCtorExpr;
 class UntypedValofExpr;
 class CompoundLiteralExpr;
@@ -104,4 +105,5 @@
 class SingleInit;
 class ListInit;
+class ConstructorInit;
 
 class Subrange;
Index: src/SynTree/TypeSubstitution.cc
===================================================================
--- src/SynTree/TypeSubstitution.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/TypeSubstitution.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// TypeSubstitution.cc -- 
+// TypeSubstitution.cc --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar  2 17:29:15 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Tue Apr 26 11:15:29 2016
 // Update Count     : 3
 //
@@ -96,5 +96,5 @@
 	BoundVarsType::const_iterator bound = boundVars.find( inst->get_name() );
 	if ( bound != boundVars.end() ) return inst;
-	
+
 	TypeEnvType::const_iterator i = typeEnv.find( inst->get_name() );
 	if ( i == typeEnv.end() ) {
@@ -217,4 +217,10 @@
 }
 
+std::ostream & operator<<( std::ostream & out, const TypeSubstitution & sub ) {
+	sub.print( out );
+	return out;
+}
+
+
 // Local Variables: //
 // tab-width: 4 //
Index: src/SynTree/TypeSubstitution.h
===================================================================
--- src/SynTree/TypeSubstitution.h	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/TypeSubstitution.h	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// TypeSubstitution.h -- 
+// TypeSubstitution.h --
 //
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Mar  2 17:33:19 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Fri Apr 29 15:00:20 2016
 // Update Count     : 2
 //
@@ -33,10 +33,10 @@
 	TypeSubstitution( const TypeSubstitution &other );
 	virtual ~TypeSubstitution();
-	
+
 	TypeSubstitution &operator=( const TypeSubstitution &other );
-	
+
 	template< typename SynTreeClass > int apply( SynTreeClass *&input );
 	template< typename SynTreeClass > int applyFree( SynTreeClass *&input );
-	
+
 	void add( std::string formalType, Type *actualType );
 	void add( const TypeSubstitution &other );
@@ -44,11 +44,12 @@
 	Type *lookup( std::string formalType ) const;
 	bool empty() const;
-	
+
 	template< typename FormalIterator, typename ActualIterator >
 	void add( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin );
-	
+
+	/// this function is unused...
 	template< typename TypeInstListIterator >
 	void extract( TypeInstListIterator begin, TypeInstListIterator end, TypeSubstitution &result );
-	
+
 	void normalize();
 
@@ -63,5 +64,5 @@
 	/// Records type variable bindings from forall-statements and instantiations of generic types
 	template< typename TypeClass > Type *handleAggregateType( TypeClass *type );
-	
+
 	virtual Type* mutate(VoidType *basicType);
 	virtual Type* mutate(BasicType *basicType);
@@ -75,7 +76,7 @@
 	virtual Type* mutate(TupleType *tupleType);
 	virtual Type* mutate(VarArgsType *varArgsType);
-	
+
 	// TODO: worry about traversing into a forall-qualified function type or type decl with assertions
-	
+
 	void initialize( const TypeSubstitution &src, TypeSubstitution &dest );
 
@@ -136,5 +137,5 @@
 	return subCount;
 }
-	
+
 template< typename SynTreeClass >
 int TypeSubstitution::applyFree( SynTreeClass *&input ) {
@@ -149,7 +150,8 @@
 	return subCount;
 }
-	
+
 template< typename TypeInstListIterator >
 void TypeSubstitution::extract( TypeInstListIterator begin, TypeInstListIterator end, TypeSubstitution &result ) {
+	// xxx - this function doesn't extract varEnv - is this intentional?
 	while ( begin != end ) {
 		TypeEnvType::iterator cur = typeEnv.find( (*begin++)->get_name() );
@@ -173,4 +175,6 @@
 }
 
+std::ostream & operator<<( std::ostream & out, const TypeSubstitution & sub );
+
 #endif // TYPESUBSTITUTION_H
 
Index: src/SynTree/Visitor.cc
===================================================================
--- src/SynTree/Visitor.cc	(revision af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Visitor.cc	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // 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 Apr  1 18:05:13 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Wed Apr 27 17:07:40 2016
 // Update Count     : 18
 //
@@ -284,4 +284,10 @@
 }
 
+void Visitor::visit( ImplicitCopyCtorExpr *impCpCtorExpr ) {
+	maybeAccept( impCpCtorExpr->get_callExpr(), *this );
+	acceptAll( impCpCtorExpr->get_tempDecls(), *this );
+	acceptAll( impCpCtorExpr->get_returnDecls(), *this );
+}
+
 void Visitor::visit( UntypedValofExpr *valofExpr ) {
 	acceptAll( valofExpr->get_results(), *this );
@@ -379,4 +385,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 af187131bf047bddfae14374ddf3536a45b617ad)
+++ src/SynTree/Visitor.h	(revision 7b3f66b14854533532aad4d0484874f36d0fa385)
@@ -5,10 +5,10 @@
 // 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 : Fri Apr  1 17:26:55 2016
+// Last Modified By : Rob Schluntz
+// Last Modified On : Thu Apr 14 15:30:58 2016
 // Update Count     : 7
 //
@@ -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 );
@@ -76,4 +76,5 @@
 	virtual void visit( TypeExpr *typeExpr );
 	virtual void visit( AsmExpr *asmExpr );
+	virtual void visit( ImplicitCopyCtorExpr *impCpCtorExpr );
 	virtual void visit( UntypedValofExpr *valofExpr );
 	virtual void visit( CompoundLiteralExpr *compLitExpr );
@@ -96,4 +97,5 @@
 	virtual void visit( SingleInit *singleInit );
 	virtual void visit( ListInit *listInit );
+	virtual void visit( ConstructorInit *ctorInit );
 
 	virtual void visit( Subrange *subrange );
