Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision d286cf68892dfb231fb65f0127f47f3d593ac9f1)
+++ src/ResolvExpr/Unify.cc	(revision 28f3a190cabb48116467ce6e1ebc74a38dac95b7)
@@ -17,5 +17,4 @@
 #include <iterator>               // for back_insert_iterator, back_inserter
 #include <map>                    // for _Rb_tree_const_iterator, _Rb_tree_i...
-#include <memory>                 // for unique_ptr
 #include <set>                    // for set
 #include <string>                 // for string, operator==, operator!=, bas...
@@ -99,8 +98,5 @@
 		findOpenVars( newSecond, openVars, closedVars, needAssertions, haveAssertions, true );
 
-		bool result = unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
-		delete newFirst;
-		delete newSecond;
-		return result;
+		return unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 	}
 
@@ -123,8 +119,5 @@
 ///   newSecond->print( std::cerr );
 ///   std::cerr << std::endl;
-		bool result = unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
-		delete newFirst;
-		delete newSecond;
-		return result;
+		return unifyExact( newFirst, newSecond, newEnv, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 	}
 
@@ -134,12 +127,5 @@
 		findOpenVars( type2, openVars, closedVars, needAssertions, haveAssertions, true );
 		Type *commonType = 0;
-		if ( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( true, true ), indexer, commonType ) ) {
-			if ( commonType ) {
-				delete commonType;
-			} // if
-			return true;
-		} else {
-			return false;
-		} // if
+		return unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, WidenMode( true, true ), indexer, commonType );
 	}
 
@@ -335,5 +321,5 @@
 
 	template< typename Iterator, typename Func >
-	std::unique_ptr<Type> combineTypes( Iterator begin, Iterator end, Func & toType ) {
+	Type* combineTypes( Iterator begin, Iterator end, Func & toType ) {
 		std::list< Type * > types;
 		for ( ; begin != end; ++begin ) {
@@ -341,5 +327,5 @@
 			flatten( toType( *begin ), back_inserter( types ) );
 		}
-		return std::unique_ptr<Type>( new TupleType( Type::Qualifiers(), types ) );
+		return new TupleType{ Type::Qualifiers(), types };
 	}
 
@@ -356,8 +342,8 @@
 			if ( isTtype1 && ! isTtype2 ) {
 				// combine all of the things in list2, then unify
-				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ).get(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else if ( isTtype2 && ! isTtype1 ) {
 				// combine all of the things in list1, then unify
-				return unifyExact( combineTypes( list1Begin, list1End, get_type ).get(), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( combineTypes( list1Begin, list1End, get_type ), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else if ( ! unifyExact( t1, t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ) ) {
 				return false;
@@ -369,5 +355,5 @@
 			Type * t1 = (*list1Begin)->get_type();
 			if ( Tuples::isTtype( t1 ) ) {
-				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ).get(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else return false;
 		} else if ( list2Begin != list2End ) {
@@ -375,5 +361,5 @@
 			Type * t2 = (*list2Begin)->get_type();
 			if ( Tuples::isTtype( t2 ) ) {
-				return unifyExact( combineTypes( list1Begin, list1End, get_type ).get(), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( combineTypes( list1Begin, list1End, get_type ), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else return false;
 		} else {
@@ -394,5 +380,4 @@
 				// expand ttype parameter into its actual type
 				if ( eqvClass->data.kind == TypeDecl::Ttype && eqvClass->type ) {
-					delete typeInst;
 					return eqvClass->type->clone();
 				}
@@ -418,5 +403,4 @@
 				dst.push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::C, nullptr, t, nullptr ) );
 			}
-			delete dcl;
 		}
 	}
@@ -427,6 +411,6 @@
 			// flatten the parameter lists for both functions so that tuple structure
 			// doesn't affect unification. Must be a clone so that the types don't change.
-			std::unique_ptr<FunctionType> flatFunc( functionType->clone() );
-			std::unique_ptr<FunctionType> flatOther( otherFunction->clone() );
+			FunctionType* flatFunc = functionType->clone();
+			FunctionType* flatOther = otherFunction->clone();
 			flattenList( flatFunc->get_parameters(), flatFunc->get_parameters(), env );
 			flattenList( flatOther->get_parameters(), flatOther->get_parameters(), env );
@@ -569,8 +553,8 @@
 			if ( isTtype1 && ! isTtype2 ) {
 				// combine all of the things in list2, then unify
-				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ).get(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else if ( isTtype2 && ! isTtype1 ) {
 				// combine all of the things in list1, then unify
-				return unifyExact( combineTypes( list1Begin, list1End, get_type ).get(), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( combineTypes( list1Begin, list1End, get_type ), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else if ( ! unifyExact( t1, t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ) ) {
 				return false;
@@ -582,5 +566,5 @@
 			Type * t1 = *list1Begin;
 			if ( Tuples::isTtype( t1 ) ) {
-				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ).get(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( t1, combineTypes( list2Begin, list2End, get_type ), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else return false;
 		} else if ( list2Begin != list2End ) {
@@ -588,5 +572,5 @@
 			Type * t2 = *list2Begin;
 			if ( Tuples::isTtype( t2 ) ) {
-				return unifyExact( combineTypes( list1Begin, list1End, get_type ).get(), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
+				return unifyExact( combineTypes( list1Begin, list1End, get_type ), t2, env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
 			} else return false;
 		} else {
@@ -597,6 +581,6 @@
 	void Unify::postvisit(TupleType *tupleType) {
 		if ( TupleType *otherTuple = dynamic_cast< TupleType* >( type2 ) ) {
-			std::unique_ptr<TupleType> flat1( tupleType->clone() );
-			std::unique_ptr<TupleType> flat2( otherTuple->clone() );
+			TupleType* flat1 = tupleType->clone();
+			TupleType* flat2 = otherTuple->clone();
 			std::list<Type *> types1, types2;
 
@@ -605,6 +589,6 @@
 			flat2->acceptMutator( expander );
 
-			flatten( flat1.get(), back_inserter( types1 ) );
-			flatten( flat2.get(), back_inserter( types2 ) );
+			flatten( flat1, back_inserter( types1 ) );
+			flatten( flat2, back_inserter( types2 ) );
 
 			result = unifyList( types1.begin(), types1.end(), types2.begin(), types2.end(), env, needAssertions, haveAssertions, openVars, indexer );
