Index: libcfa/prelude/builtins.c
===================================================================
--- libcfa/prelude/builtins.c	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ libcfa/prelude/builtins.c	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -111,4 +111,27 @@
 static inline unsigned int ?\=?( unsigned int & x, unsigned long int y ) { x = x \ y; return x; }
 
+// type that wraps a pointer and a destructor-like function - used in generating implicit destructor calls for struct members in user-defined functions
+forall(dtype T)
+struct __Destructor {
+  T * object;
+  void (*dtor)(T *);
+};
+
+// defined destructor in the case that non-generated code wants to use __Destructor
+forall(dtype T)
+static inline void ^?{}(__Destructor(T) & x) {
+	if (x.object && x.dtor) {
+	  x.dtor(x.object);
+	}
+}
+
+// easy interface into __Destructor's destructor for easy codegen purposes
+extern "C" {
+  forall(dtype T)
+  static inline void __destroy_Destructor(__Destructor(T) * dtor) {
+    ^(*dtor){};
+  }
+}
+
 // Local Variables: //
 // mode: c //
Index: src/ControlStruct/ExceptTranslate.cc
===================================================================
--- src/ControlStruct/ExceptTranslate.cc	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ src/ControlStruct/ExceptTranslate.cc	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -319,6 +319,6 @@
 			}
 
-			block->push_back( handler->get_body() );
-			handler->set_body( nullptr );
+			block->push_back( handler->body );
+			handler->body = nullptr;
 
 			std::list<Statement *> caseBody
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ src/InitTweak/FixInit.cc	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -54,4 +54,5 @@
 #include "SynTree/Type.h"              // for Type, Type::StorageClasses
 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution, operator<<
+#include "SynTree/DeclReplacer.h"      // for DeclReplacer
 #include "SynTree/Visitor.h"           // for acceptAll, maybeAccept
 
@@ -162,10 +163,6 @@
 			using Parent::previsit;
 
-			void previsit( ObjectDecl * objDecl );
 			void previsit( FunctionDecl * funcDecl );
 
-			void previsit( CompoundStmt * compoundStmt );
-			void postvisit( CompoundStmt * compoundStmt );
-			void previsit( ReturnStmt * returnStmt );
 			void previsit( BranchStmt * stmt );
 		private:
@@ -207,4 +204,6 @@
 			static void generate( std::list< Declaration * > & translationUnit );
 
+			void premutate( StructDecl * structDecl );
+
 			void premutate( FunctionDecl * funcDecl );
 			DeclarationWithType * postmutate( FunctionDecl * funcDecl );
@@ -228,4 +227,8 @@
 			bool isCtor = false; // true if current function is a constructor
 			StructDecl * structDecl = nullptr;
+
+			// special built-in functions necessary for this to work
+			StructDecl * dtorStruct = nullptr;
+			FunctionDecl * dtorStructDestroy = nullptr;
 		};
 
@@ -732,4 +735,55 @@
 		}
 
+		DeclarationWithType * getDtorFunc( ObjectDecl * objDecl, Statement * input, std::list< Statement * > & stmtsToAdd ) {
+			// unwrap implicit statement wrapper
+			Statement * dtor = input;
+			if ( ImplicitCtorDtorStmt * implicit = dynamic_cast< ImplicitCtorDtorStmt * >( input ) ) {
+				// dtor = implicit->callStmt;
+				// implicit->callStmt = nullptr;
+			}
+			assert( dtor );
+			std::list< Expression * > matches;
+			collectCtorDtorCalls( dtor, matches );
+
+			if ( dynamic_cast< ExprStmt * >( dtor ) ) {
+				// only one destructor call in the expression
+				if ( matches.size() == 1 ) {
+					DeclarationWithType * func = getFunction( matches.front() );
+					assertf( func, "getFunction failed to find function in %s", toString( matches.front() ).c_str() );
+
+					// cleanup argument must be a function, not an object (including function pointer)
+					if ( FunctionDecl * dtorFunc = dynamic_cast< FunctionDecl * > ( func ) ) {
+						if ( dtorFunc->type->forall.empty() ) {
+							// simple case where the destructor is a monomorphic function call - can simply
+							// use that function as the cleanup function.
+							delete dtor;
+							return func;
+						}
+					}
+				}
+			}
+
+			// otherwise the cleanup is more complicated - need to build a single argument cleanup function that
+			// wraps the more complicated code.
+			static UniqueName dtorNamer( "__cleanup_dtor" );
+			FunctionDecl * dtorFunc = FunctionDecl::newFunction( dtorNamer.newName(), SymTab::genDefaultType( objDecl->type->stripReferences(), false ), new CompoundStmt() );
+			stmtsToAdd.push_back( new DeclStmt( dtorFunc ) );
+
+			// the original code contains uses of objDecl - replace them with the newly generated 'this' parameter.
+			ObjectDecl * thisParam = getParamThis( dtorFunc->type );
+			Expression * replacement = new VariableExpr( thisParam );
+
+			Type * base = replacement->result->stripReferences();
+			if ( dynamic_cast< ArrayType * >( base ) || dynamic_cast< TupleType * > ( base ) ) {
+				// need to cast away reference for array types, since the destructor is generated without the reference type,
+				// and for tuple types since tuple indexing does not work directly on a reference
+				replacement = new CastExpr( replacement, base->clone() );
+			}
+			DeclReplacer::replace( dtor, { std::make_pair( objDecl, replacement ) } );
+			dtorFunc->statements->push_back( strict_dynamic_cast<Statement *>( dtor ) );
+
+			return dtorFunc;
+		}
+
 		DeclarationWithType * FixInit::postmutate( ObjectDecl *objDecl ) {
 			// since this removes the init field from objDecl, it must occur after children are mutated (i.e. postmutate)
@@ -844,4 +898,19 @@
 							ctorInit->ctor = nullptr;
 						}
+
+						Statement * dtor = ctorInit->dtor;
+						if ( dtor ) {
+							ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * >( dtor );
+							Statement * dtorStmt = implicit->callStmt;
+
+							// don't need to call intrinsic dtor, because it does nothing, but
+							// non-intrinsic dtors must be called
+							if ( ! isIntrinsicSingleArgCallStmt( dtorStmt ) ) {
+								// set dtor location to the object's location for error messages
+								DeclarationWithType * dtorFunc = getDtorFunc( objDecl, dtorStmt, stmtsToAddBefore );
+								objDecl->attributes.push_back( new Attribute( "cleanup", { new VariableExpr( dtorFunc ) } ) );
+								ctorInit->dtor = nullptr;
+							} // if
+						}
 					} // if
 				} else if ( Initializer * init = ctorInit->init ) {
@@ -886,36 +955,4 @@
 
 
-		template<typename Iterator, typename OutputIterator>
-		void insertDtors( Iterator begin, Iterator end, OutputIterator out ) {
-			for ( Iterator it = begin ; it != end ; ++it ) {
-				// extract destructor statement from the object decl and insert it into the output. Note that this is
-				// only called on lists of non-static objects with implicit non-intrinsic dtors, so if the user manually
-				// calls an intrinsic dtor then the call must (and will) still be generated since the argument may
-				// contain side effects.
-				ObjectDecl * objDecl = *it;
-				ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() );
-				assert( ctorInit && ctorInit->get_dtor() );
-				*out++ = ctorInit->get_dtor()->clone();
-			} // for
-		}
-
-		void InsertDtors::previsit( ObjectDecl * objDecl ) {
-			// remember non-static destructed objects so that their destructors can be inserted later
-			if ( ! objDecl->get_storageClasses().is_static ) {
-				if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
-					// a decision should have been made by the resolver, so ctor and init are not both non-NULL
-					assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
-					Statement * dtor = ctorInit->get_dtor();
-					// don't need to call intrinsic dtor, because it does nothing, but
-					// non-intrinsic dtors must be called
-					if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) {
-						// set dtor location to the object's location for error messages
-						ctorInit->dtor->location = objDecl->location;
-						reverseDeclOrder.front().push_front( objDecl );
-					} // if
-				} // if
-			} // if
-		}
-
 		void InsertDtors::previsit( FunctionDecl * funcDecl ) {
 			// each function needs to have its own set of labels
@@ -930,29 +967,4 @@
 		}
 
-		void InsertDtors::previsit( CompoundStmt * compoundStmt ) {
-			// visit statements - this will also populate reverseDeclOrder list.  don't want to dump all destructors
-			// when block is left, just the destructors associated with variables defined in this block, so push a new
-			// list to the top of the stack so that we can differentiate scopes
-			reverseDeclOrder.push_front( OrderedDecls() );
-			Parent::previsit( compoundStmt );
-		}
-
-		void InsertDtors::postvisit( CompoundStmt * compoundStmt ) {
-			// add destructors for the current scope that we're exiting, unless the last statement is a return, which
-			// causes unreachable code warnings
-			std::list< Statement * > & statements = compoundStmt->get_kids();
-			if ( ! statements.empty() && ! dynamic_cast< ReturnStmt * >( statements.back() ) ) {
-				insertDtors( reverseDeclOrder.front().begin(), reverseDeclOrder.front().end(), back_inserter( statements ) );
-			}
-			reverseDeclOrder.pop_front();
-		}
-
-		void InsertDtors::previsit( ReturnStmt * ) {
-			// return exits all scopes, so dump destructors for all scopes
-			for ( OrderedDecls & od : reverseDeclOrder ) {
-				insertDtors( od.begin(), od.end(), back_inserter( stmtsToAddBefore ) );
-			} // for
-		}
-
 		// Handle break/continue/goto in the same manner as C++.  Basic idea: any objects that are in scope at the
 		// BranchStmt but not at the labelled (target) statement must be destructed.  If there are any objects in scope
@@ -982,22 +994,4 @@
 			if ( ! diff.empty() ) {
 				SemanticError( stmt, std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " " );
-			} // if
-			// S_G-S_L results in set of objects that must be destructed
-			diff.clear();
-			std::set_difference( curVars.begin(), curVars.end(), lvars.begin(), lvars.end(), std::inserter( diff, diff.end() ) );
-			DTOR_PRINT(
-				std::cerr << "S_G-S_L = " << printSet( diff ) << std::endl;
-			)
-			if ( ! diff.empty() ) {
-				// create an auxilliary set for fast lookup -- can't make diff a set, because diff ordering should be consistent for error messages.
-				std::unordered_set<ObjectDecl *> needsDestructor( diff.begin(), diff.end() );
-
-				// go through decl ordered list of objectdecl. for each element that occurs in diff, output destructor
-				OrderedDecls ordered;
-				for ( OrderedDecls & rdo : reverseDeclOrder ) {
-					// add elements from reverseDeclOrder into ordered if they occur in diff - it is key that this happens in reverse declaration order.
-					copy_if( rdo.begin(), rdo.end(), back_inserter( ordered ), [&]( ObjectDecl * objDecl ) { return needsDestructor.count( objDecl ); } );
-				} // for
-				insertDtors( ordered.begin(), ordered.end(), back_inserter( stmtsToAddBefore ) );
 			} // if
 		}
@@ -1025,4 +1019,10 @@
 		}
 
+		void GenStructMemberCalls::premutate( StructDecl * structDecl ) {
+			if ( ! dtorStruct && structDecl->name == "__Destructor" ) {
+				dtorStruct = structDecl;
+			}
+		}
+
 		void GenStructMemberCalls::premutate( FunctionDecl * funcDecl ) {
 			GuardValue( function );
@@ -1037,4 +1037,9 @@
 			unhandled.clear();
 			usedUninit.clear();
+
+			if ( ! dtorStructDestroy && funcDecl->name == "__destroy_Destructor" ) {
+				dtorStructDestroy = funcDecl;
+				return;
+			}
 
 			function = funcDecl;
@@ -1048,4 +1053,5 @@
 				if ( structType ) {
 					structDecl = structType->get_baseStruct();
+					if ( structDecl == dtorStruct ) return;
 					for ( Declaration * member : structDecl->get_members() ) {
 						if ( ObjectDecl * field = dynamic_cast< ObjectDecl * >( member ) ) {
@@ -1116,8 +1122,29 @@
 							callStmt->acceptMutator( *visitor );
 							if ( isCtor ) {
-								function->get_statements()->push_front( callStmt );
+								function->statements->push_front( callStmt );
 							} else {
 								// destructor statements should be added at the end
-								function->get_statements()->push_back( callStmt );
+								// function->get_statements()->push_back( callStmt );
+
+								// Destructor _dtor0 = { &b.a1, (void (*)(void *)_destroy_A };
+								std::list< Statement * > stmtsToAdd;
+
+								static UniqueName memberDtorNamer = { "__memberDtor" };
+								assertf( dtorStruct, "builtin __Destructor not found." );
+								assertf( dtorStructDestroy, "builtin __destroy_Destructor not found." );
+
+								Expression * thisExpr = new AddressExpr( new VariableExpr( thisParam ) );
+								Expression * dtorExpr = new VariableExpr( getDtorFunc( thisParam, callStmt, stmtsToAdd ) );
+
+								// cast destructor pointer to void (*)(void *), to silence GCC incompatible pointer warnings
+								FunctionType * dtorFtype = new FunctionType( Type::Qualifiers(), false );
+								dtorFtype->parameters.push_back( ObjectDecl::newObject( "", new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), nullptr ) );
+								Type * dtorType = new PointerType( Type::Qualifiers(), dtorFtype );
+
+								ObjectDecl * destructor = ObjectDecl::newObject( memberDtorNamer.newName(), new StructInstType( Type::Qualifiers(), dtorStruct ), new ListInit( { new SingleInit( thisExpr ), new SingleInit( new CastExpr( dtorExpr, dtorType ) ) } ) );
+								function->statements->push_front( new DeclStmt( destructor ) );
+								destructor->attributes.push_back( new Attribute( "cleanup", { new VariableExpr( dtorStructDestroy ) } ) );
+
+								function->statements->kids.splice( function->statements->kids.begin(), stmtsToAdd );
 							}
 						} catch ( SemanticErrorException & error ) {
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ src/InitTweak/InitTweak.cc	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -339,5 +339,5 @@
 		std::list< Expression * > matches;
 		collectCtorDtorCalls( stmt, matches );
-		assert( matches.size() <= 1 );
+		assertf( matches.size() <= 1, "%zd constructor/destructors found in %s", matches.size(), toString( stmt ).c_str() );
 		return matches.size() == 1 ? matches.front() : nullptr;
 	}
Index: src/SymTab/Autogen.cc
===================================================================
--- src/SymTab/Autogen.cc	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ src/SymTab/Autogen.cc	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -45,5 +45,5 @@
 	/// Data used to generate functions generically. Specifically, the name of the generated function and a function which generates the routine protoype
 	struct FuncData {
-		typedef FunctionType * (*TypeGen)( Type * );
+		typedef FunctionType * (*TypeGen)( Type *, bool );
 		FuncData( const std::string & fname, const TypeGen & genType ) : fname( fname ), genType( genType ) {}
 		std::string fname;
@@ -231,8 +231,11 @@
 
 	/// given type T, generate type of default ctor/dtor, i.e. function type void (*) (T *)
-	FunctionType * genDefaultType( Type * paramType ) {
-		const auto & typeParams = getGenericParams( paramType );
+	FunctionType * genDefaultType( Type * paramType, bool maybePolymorphic ) {
 		FunctionType *ftype = new FunctionType( Type::Qualifiers(), false );
-		cloneAll( typeParams, ftype->forall );
+		if ( maybePolymorphic ) {
+			// only copy in
+			const auto & typeParams = getGenericParams( paramType );
+			cloneAll( typeParams, ftype->forall );
+		}
 		ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr );
 		ftype->parameters.push_back( dstParam );
@@ -241,6 +244,6 @@
 
 	/// given type T, generate type of copy ctor, i.e. function type void (*) (T *, T)
-	FunctionType * genCopyType( Type * paramType ) {
-		FunctionType *ftype = genDefaultType( paramType );
+	FunctionType * genCopyType( Type * paramType, bool maybePolymorphic ) {
+		FunctionType *ftype = genDefaultType( paramType, maybePolymorphic );
 		ObjectDecl *srcParam = new ObjectDecl( "_src", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
 		ftype->parameters.push_back( srcParam );
@@ -249,6 +252,6 @@
 
 	/// given type T, generate type of assignment, i.e. function type T (*) (T *, T)
-	FunctionType * genAssignType( Type * paramType ) {
-		FunctionType *ftype = genCopyType( paramType );
+	FunctionType * genAssignType( Type * paramType, bool maybePolymorphic ) {
+		FunctionType *ftype = genCopyType( paramType, maybePolymorphic );
 		ObjectDecl *returnVal = new ObjectDecl( "_ret", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
 		ftype->returnVals.push_back( returnVal );
@@ -308,5 +311,5 @@
 		for ( const FuncData & d : data ) {
 			// generate a function (?{}, ?=?, ^?{}) based on the current FuncData.
-			FunctionType * ftype = d.genType( type );
+			FunctionType * ftype = d.genType( type, true );
 
 			// destructor for concurrent type must be mutex
Index: src/SymTab/Autogen.h
===================================================================
--- src/SymTab/Autogen.h	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ src/SymTab/Autogen.h	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -45,12 +45,15 @@
 	extern FunctionDecl * dereferenceOperator;
 
-	// generate the type of an assignment function for paramType
-	FunctionType * genAssignType( Type * paramType );
-
-	// generate the type of a default constructor or destructor for paramType
-	FunctionType * genDefaultType( Type * paramType );
-
-	// generate the type of a copy constructor for paramType
-	FunctionType * genCopyType( Type * paramType );
+	/// generate the type of an assignment function for paramType.
+	/// maybePolymorphic is true if the resulting FunctionType is allowed to be polymorphic
+	FunctionType * genAssignType( Type * paramType, bool maybePolymorphic = true );
+
+	/// generate the type of a default constructor or destructor for paramType.
+	/// maybePolymorphic is true if the resulting FunctionType is allowed to be polymorphic
+	FunctionType * genDefaultType( Type * paramType, bool maybePolymorphic = true );
+
+	/// generate the type of a copy constructor for paramType.
+	/// maybePolymorphic is true if the resulting FunctionType is allowed to be polymorphic
+	FunctionType * genCopyType( Type * paramType, bool maybePolymorphic = true );
 
 	/// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls.
Index: src/SynTree/DeclReplacer.cc
===================================================================
--- src/SynTree/DeclReplacer.cc	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ src/SynTree/DeclReplacer.cc	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -38,4 +38,16 @@
 			void previsit( TypeInstType * inst );
 		};
+
+		/// Mutator that replaces uses of declarations with arbitrary expressions, according to the supplied mapping
+		struct ExprDeclReplacer {
+		private:
+			const ExprMap & exprMap;
+			bool debug;
+		public:
+			ExprDeclReplacer( const ExprMap & exprMap, bool debug = false );
+
+			// replace variable with new node from expr map
+			Expression * postmutate( VariableExpr * varExpr );
+		};
 	}
 
@@ -53,4 +65,9 @@
 		DeclMap declMap;
 		replace( node, declMap, typeMap, debug );
+	}
+
+	void replace( BaseSyntaxNode *& node, const ExprMap & exprMap, bool debug ) {
+		PassVisitor<ExprDeclReplacer> replacer( exprMap, debug );
+		node = maybeMutate( node, replacer );
 	}
 
@@ -79,4 +96,19 @@
 			}
 		}
+
+		ExprDeclReplacer::ExprDeclReplacer( const ExprMap & exprMap, bool debug ) : exprMap( exprMap ), debug( debug ) {}
+
+		Expression * ExprDeclReplacer::postmutate( VariableExpr * varExpr ) {
+			if ( exprMap.count( varExpr->var ) ) {
+				Expression * replacement = exprMap.at( varExpr->var )->clone();
+				if ( debug ) {
+					std::cerr << "replacing variable reference: " << (void*)varExpr->var << " " << varExpr->var << " with " << (void*)replacement << " " << replacement << std::endl;
+				}
+				std::swap( varExpr->env, replacement->env );
+				delete varExpr;
+				return replacement;
+			}
+			return varExpr;
+		}
 	}
 } // namespace VarExprReplacer
Index: src/SynTree/DeclReplacer.h
===================================================================
--- src/SynTree/DeclReplacer.h	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ src/SynTree/DeclReplacer.h	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -26,8 +26,19 @@
 	typedef std::map< DeclarationWithType *, DeclarationWithType * > DeclMap;
 	typedef std::map< TypeDecl *, TypeDecl * > TypeMap;
+	typedef std::map< DeclarationWithType *, Expression * > ExprMap;
 
 	void replace( BaseSyntaxNode * node, const DeclMap & declMap, bool debug = false );
 	void replace( BaseSyntaxNode * node, const TypeMap & typeMap, bool debug = false );
 	void replace( BaseSyntaxNode * node, const DeclMap & declMap, const TypeMap & typeMap, bool debug = false );
+
+	void replace( BaseSyntaxNode *& node, const ExprMap & exprMap, bool debug = false);
+	template<typename T>
+		void replace( T *& node, const ExprMap & exprMap, bool debug = false ) {
+		if ( ! node ) return;
+		BaseSyntaxNode * arg = node;
+		replace( arg, exprMap, debug );
+		node = dynamic_cast<T *>( arg );
+		assertf( node, "DeclReplacer fundamentally changed the type of its argument." );
+	}
 }
 
Index: tests/raii/.expect/memberCtors.txt
===================================================================
--- tests/raii/.expect/memberCtors.txt	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ tests/raii/.expect/memberCtors.txt	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -98,4 +98,5 @@
 end copy construct A
 End of main
+begin destruct B
 constructing int
 constructing int
@@ -146,13 +147,15 @@
 destructing int: 0
 destructing int: 1000
-destructing int: 0
-destructing int: 0
-destructing int: 999
-destructing int: 0
-destructing int: 0
-destructing int: 0
-destructing int: 0
-destructing int: 0
-destructing int: 999
+end destruct B
+destructing int: 0
+destructing int: 0
+destructing int: 999
+destructing int: 0
+destructing int: 0
+destructing int: 0
+destructing int: 0
+destructing int: 0
+destructing int: 999
+begin destruct B
 constructing int
 constructing int
@@ -203,11 +206,12 @@
 destructing int: 0
 destructing int: 1000
-destructing int: 0
-destructing int: 0
-destructing int: 999
-destructing int: 0
-destructing int: 0
-destructing int: 0
-destructing int: 0
-destructing int: 0
-destructing int: 999
+end destruct B
+destructing int: 0
+destructing int: 0
+destructing int: 999
+destructing int: 0
+destructing int: 0
+destructing int: 0
+destructing int: 0
+destructing int: 0
+destructing int: 999
Index: tests/raii/memberCtors.c
===================================================================
--- tests/raii/memberCtors.c	(revision 2a9d12dc79ed339ec9a54e2e436ad3f508d71823)
+++ tests/raii/memberCtors.c	(revision 381bea69eb8b86074ee4096b96a9b80542346e12)
@@ -22,8 +22,15 @@
 }
 
-void ?=?(WrappedInt & this, int x) {
+/* WrappedInt */ void ?=?(WrappedInt & this, int x) {
   printf("assigning int: %d %d\n", this.x, x);
   this.x = x;
+  // return this;
 }
+
+// WrappedInt ?=?(WrappedInt & this, WrappedInt other) {
+//   printf("assigning int: %d %d\n", this.x, other.x);
+//   this.x = other.x;
+//   return this;
+// }
 
 struct A {
@@ -79,11 +86,13 @@
 
 void ^?{}(B & b) {
+  printf("begin destruct B\n");
   b.a2 = (A) { 0 };
   ^(b.a1){};
+  printf("end destruct B\n");
 } // a2, a3 never destructed - will be automatically destructed
 
 int main() {
   printf("Before declaration of b1\n");
-  B b1;
+  B b1;  // b1 = { { 1000, 0, 0 }, { 1001, 0, 0 }, { 0, 0, 0 } }
   printf("Before declaration of b2\n");
   B b2 = b1;
