Index: src/AST/Pass.hpp
===================================================================
--- src/AST/Pass.hpp	(revision 61c7239fc01dff737fe459a153710b3f7d561d1c)
+++ src/AST/Pass.hpp	(revision e7f8119c7b8ee2a61854ccbb31648dbd9fb6b85a)
@@ -262,7 +262,13 @@
 /// Used to restore values/functions/etc. when the Pass finishes visiting this node
 class WithGuards {
-	__pass::at_cleanup_t at_cleanup;
-
+	__pass::at_cleanup_t at_cleanup = [](__pass::cleanup_func_t, void*) {
+		std::cerr << "No cleanup function was set" << std::endl;
+		abort();
+	};
+
+	template< typename pass_t>
+	friend auto __pass::at_cleanup( pass_t & pass, int ) -> decltype( &pass.at_cleanup );
 public:
+
 	/// When this node is finished being visited, restore the value of a variable
 	template< typename T >
