Index: src/SynTree/CommaExpr.cc
===================================================================
--- src/SynTree/CommaExpr.cc	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/CommaExpr.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Mon May 02 15:11:29 2016
+// Last Modified On : Mon May 02 15:19:44 2016
 // Update Count     : 1
 //
Index: src/SynTree/CompoundStmt.cc
===================================================================
--- src/SynTree/CompoundStmt.cc	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/CompoundStmt.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Mon May 02 15:10:47 2016
+// 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 );
+  }
 }
 
Index: src/SynTree/Constant.cc
===================================================================
--- src/SynTree/Constant.cc	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Constant.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -30,13 +30,13 @@
 Constant::~Constant() { delete type; }
 
-Constant Constant::from( int i ) {
+Constant Constant::from_int( int i ) {
 	return Constant( new BasicType( Type::Qualifiers(), BasicType::SignedInt ), std::to_string( i ) );
 }
 
-Constant Constant::from( unsigned long i ) {
+Constant Constant::from_ulong( unsigned long i ) {
 	return Constant( new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), std::to_string( i ) );
 }
 
-Constant Constant::from( double d ) {
+Constant Constant::from_double( double d ) {
 	return Constant( new BasicType( Type::Qualifiers(), BasicType::Double ), std::to_string( d ) );
 }
Index: src/SynTree/Constant.h
===================================================================
--- src/SynTree/Constant.h	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Constant.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -33,9 +33,9 @@
 
 	/// generates an integer constant of the given int
-	static Constant from( int i );
+	static Constant from_int( int i );
 	/// generates an integer constant of the given unsigned long int
-	static Constant from( unsigned long i );
+	static Constant from_ulong( unsigned long i );
 	/// generates a floating point constant of the given double
-	static Constant from( double d );
+	static Constant from_double( double d );
 
 	virtual Constant *clone() const;
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Declaration.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -5,10 +5,10 @@
 // file "LICENCE" distributed with Cforall.
 //
-// Declaration.h -- 
+// Declaration.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:28:11 2016
+// Last Modified By : Rob Schluntz
+// 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;
 };
 
@@ -106,5 +115,17 @@
 	typedef DeclarationWithType Parent;
   public:
-	FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn );
+	// temporary - merge this into general GCC attributes
+	struct Attribute {
+		enum Type {
+			NoAttribute, Constructor, Destructor,
+		} type;
+		enum Priority {
+			// priorities 0-100 are reserved by gcc, so it's okay to use 100 an exceptional case
+			Default = 100, High,
+		} priority;
+		Attribute(Type t = NoAttribute, Priority p = Default) : type(t), priority(p) {};
+	};
+
+	FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute = Attribute() );
 	FunctionDecl( const FunctionDecl &other );
 	virtual ~FunctionDecl();
@@ -119,4 +140,6 @@
 	std::list< std::string >& get_oldIdents() { return oldIdents; }
 	std::list< Declaration* >& get_oldDecls() { return oldDecls; }
+	Attribute get_attribute() const { return attribute; }
+	void set_attribute( Attribute newValue ) { attribute = newValue; }
 
 	virtual FunctionDecl *clone() const { return new FunctionDecl( *this ); }
@@ -130,4 +153,5 @@
 	std::list< std::string > oldIdents;
 	std::list< Declaration* > oldDecls;
+	Attribute attribute;
 };
 
Index: src/SynTree/DeclarationWithType.cc
===================================================================
--- src/SynTree/DeclarationWithType.cc	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/DeclarationWithType.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Expression.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri May 13 13:19:09 2016
+// Last Modified On : Fri May 13 13:23:11 2016
 // Update Count     : 40
 //
@@ -78,4 +78,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 ) {
@@ -464,4 +466,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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Expression.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/FunctionDecl.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Tue May 03 15:37:43 2016
+// Last Modified On : Fri May 06 15:59:48 2016
 // Update Count     : 19
 //
@@ -21,6 +21,6 @@
 #include "Common/utility.h"
 
-FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn )
-		: Parent( name, sc, linkage ), type( type ), statements( statements ) {
+FunctionDecl::FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute )
+		: Parent( name, sc, linkage ), type( type ), statements( statements ), attribute( attribute ) {
 	set_isInline( isInline );
 	set_isNoreturn( isNoreturn );
@@ -32,5 +32,5 @@
 
 FunctionDecl::FunctionDecl( const FunctionDecl &other )
-	: Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ) {
+	: Parent( other ), type( maybeClone( other.type ) ), statements( maybeClone( other.statements ) ), attribute( other.attribute ) {
 }
 
@@ -65,4 +65,17 @@
 		os << "_Noreturn ";
 	} // if
+	switch ( attribute.type ) {
+		case Attribute::Constructor:
+			os << "Global Constructor ";
+			break;
+		case Attribute::Destructor:
+			os << "Global Destructor ";
+			break;
+		default:
+			break;
+	}
+	if ( attribute.priority != Attribute::Default ) {
+		os << "with priority " << attribute.priority << " ";
+	}
 	if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
 		os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
@@ -105,4 +118,17 @@
 		os << "_Noreturn ";
 	} // if
+	switch ( attribute.type ) {
+		case Attribute::Constructor:
+			os << " Global Constructor ";
+			break;
+		case Attribute::Destructor:
+			os << " Global Destructor ";
+			break;
+		default:
+			break;
+	}
+	if ( attribute.priority != Attribute::Default ) {
+		os << "with priority " << attribute.priority << " ";
+	}
 	if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
 		os << DeclarationNode::storageName[ get_storageClass() ] << ' ';
Index: src/SynTree/Initializer.cc
===================================================================
--- src/SynTree/Initializer.cc	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Initializer.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri May 13 13:19:30 2016
+// Last Modified On : Fri May 13 13:23:03 2016
 // Update Count     : 28
 //
@@ -16,7 +16,8 @@
 #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 );
 }
@@ -56,6 +57,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 ) {
 }
 
@@ -81,4 +82,42 @@
 		(*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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Initializer.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Mutator.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Mutator.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/ObjectDecl.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -10,5 +10,5 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Fri May 13 13:20:17 2016
+// Last Modified On : Fri May 13 13:23:32 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 )
@@ -58,4 +59,6 @@
 		os << " with initializer ";
 		init->print( os, indent );
+		os << std::endl << std::string(indent, ' ');
+		os << "maybeConstructed? " << init->get_maybeConstructed();
 	} // if
 
Index: src/SynTree/SynTree.h
===================================================================
--- src/SynTree/SynTree.h	(revision bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/SynTree.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/TypeSubstitution.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/TypeSubstitution.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Visitor.cc	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 bb8ea3011a8148746d8e28699f24b68eaa57a951)
+++ src/SynTree/Visitor.h	(revision d6681823cf43689609e83bcc9077750fba1c262d)
@@ -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 );
