Index: src/AST/Node.cpp
===================================================================
--- src/AST/Node.cpp	(revision 0f6a775253ac135c7aefa8bf075ce817231ec7d1)
+++ src/AST/Node.cpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -17,4 +17,5 @@
 #include "Fwd.hpp"
 
+#include <csignal>  // MEMORY DEBUG -- for raise
 #include <iostream>
 
@@ -28,4 +29,17 @@
 
 #include "Print.hpp"
+
+/// MEMORY DEBUG -- allows breaking on construction/destruction of dynamically chosen object.
+/// Process to use in GDB:
+///   break ast::Node::_trap()
+///   run
+///   set variable MEM_TRAP_OBJ = <target>
+///   disable <first breakpoint>
+///   continue
+void * MEM_TRAP_OBJ = nullptr;
+
+void ast::Node::_trap() {
+	if ( this == MEM_TRAP_OBJ ) std::raise(SIGTRAP);
+}
 
 template< typename node_t, enum ast::Node::ref_type ref_t >
Index: src/AST/Node.hpp
===================================================================
--- src/AST/Node.hpp	(revision 0f6a775253ac135c7aefa8bf075ce817231ec7d1)
+++ src/AST/Node.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -30,13 +30,15 @@
 /// Keeps both strong and weak reference counts.
 class Node {
+	/// call to debug on node creation/deletion
+	void _trap();
 public:
 	// override defaults to ensure assignment doesn't
 	// change/share reference counts
-	Node() = default;
-	Node(const Node&) : strong_count(0), weak_count(0) {}
-	Node(Node&&) : strong_count(0), weak_count(0) {}
+	Node() { _trap(); }
+	Node(const Node&) : strong_count(0), weak_count(0) { _trap(); }
+	Node(Node&&) : strong_count(0), weak_count(0) { _trap(); }
 	Node& operator= (const Node&) = delete;
 	Node& operator= (Node&&) = delete;
-	virtual ~Node() = default;
+	virtual ~Node() { _trap(); }
 
 	virtual const Node * accept( Visitor & v ) const = 0;
Index: src/AST/Pass.hpp
===================================================================
--- src/AST/Pass.hpp	(revision 0f6a775253ac135c7aefa8bf075ce817231ec7d1)
+++ src/AST/Pass.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -209,6 +209,6 @@
 	/// Internal RAII guard for symbol table features
 	struct guard_symtab {
-		guard_symtab( Pass<pass_t> & pass ): pass( pass ) { __pass::symtab::enter(pass, 0); }
-		~guard_symtab()                                   { __pass::symtab::leave(pass, 0); }
+		guard_symtab( Pass<pass_t> & pass ): pass( pass ) { __pass::symtab::enter(pass.pass, 0); }
+		~guard_symtab()                                   { __pass::symtab::leave(pass.pass, 0); }
 		Pass<pass_t> & pass;
 	};
@@ -216,6 +216,6 @@
 	/// Internal RAII guard for scope features
 	struct guard_scope {
-		guard_scope( Pass<pass_t> & pass ): pass( pass ) { __pass::scope::enter(pass, 0); }
-		~guard_scope()                                   { __pass::scope::leave(pass, 0); }
+		guard_scope( Pass<pass_t> & pass ): pass( pass ) { __pass::scope::enter(pass.pass, 0); }
+		~guard_scope()                                   { __pass::scope::leave(pass.pass, 0); }
 		Pass<pass_t> & pass;
 	};
Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision 0f6a775253ac135c7aefa8bf075ce817231ec7d1)
+++ src/AST/Pass.impl.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -429,12 +429,12 @@
 			guard_symtab guard { *this };
 			// implicit add __func__ identifier as specified in the C manual 6.4.2.2
-			static ast::ObjectDecl func(
-				node->location, "__func__",
-				new ast::ArrayType(
-					new ast::BasicType( ast::BasicType::Char, ast::CV::Qualifiers( ast::CV::Const ) ),
+			static ast::ptr< ast::ObjectDecl > func{ new ast::ObjectDecl{ 
+				CodeLocation{}, "__func__",
+				new ast::ArrayType{
+					new ast::BasicType{ ast::BasicType::Char, ast::CV::Const },
 					nullptr, VariableLen, DynamicDim
-				)
-			);
-			__pass::symtab::addId( pass, 0, &func );
+				}
+			} };
+			__pass::symtab::addId( pass, 0, func );
 			VISIT(
 				maybe_accept( node, &FunctionDecl::type );
@@ -610,8 +610,8 @@
 	VISIT({
 		// do not enter a new scope if inFunction is true - needs to check old state before the assignment
-		auto guard1 = makeFuncGuard( [this, inFunction = this->inFunction]() {
-			if ( ! inFunction ) __pass::symtab::enter(pass, 0);
-		}, [this, inFunction = this->inFunction]() {
-			if ( ! inFunction ) __pass::symtab::leave(pass, 0);
+		auto guard1 = makeFuncGuard( [this, inFunctionCpy = this->inFunction]() {
+			if ( ! inFunctionCpy ) __pass::symtab::enter(pass, 0);
+		}, [this, inFunctionCpy = this->inFunction]() {
+			if ( ! inFunctionCpy ) __pass::symtab::leave(pass, 0);
 		});
 		ValueGuard< bool > guard2( inFunction );
Index: src/AST/Pass.proto.hpp
===================================================================
--- src/AST/Pass.proto.hpp	(revision 0f6a775253ac135c7aefa8bf075ce817231ec7d1)
+++ src/AST/Pass.proto.hpp	(revision 9ea38de4515063905b11e8dd973b76e59c7671a8)
@@ -270,5 +270,5 @@
 		// Some simple scoping rules
 		template<typename pass_t>
-		static inline auto enter( pass_t & pass, int ) -> decltype( pass.symtab.enterScope(), void() ) {
+		static inline auto enter( pass_t & pass, int ) -> decltype( pass.symtab, void() ) {
 			pass.symtab.enterScope();
 		}
@@ -278,5 +278,5 @@
 
 		template<typename pass_t>
-		static inline auto leave( pass_t & pass, int ) -> decltype( pass.symtab.leaveScope(), void() ) {
+		static inline auto leave( pass_t & pass, int ) -> decltype( pass.symtab, void() ) {
 			pass.symtab.leaveScope();
 		}
