Index: src/AST/Pass.hpp
===================================================================
--- src/AST/Pass.hpp	(revision ac16a55f7512bec1c4c5356fdd304e8df5883e26)
+++ src/AST/Pass.hpp	(revision 69dd8e6342b54684c5b4532978f3c1537b01b01d)
@@ -233,5 +233,5 @@
 private:
 
-	bool __visit_children() { __pass::bool_ref * ptr = __pass::visit_children(core, 0); return ptr ? *ptr : true; }
+	bool __visit_children() { bool * ptr = __pass::visit_children(core, 0); return ptr ? *ptr : true; }
 
 private:
@@ -342,5 +342,5 @@
 /// set visit_children false of all child nodes should be ignored
 struct WithShortCircuiting {
-	__pass::bool_ref visit_children;
+	bool visit_children;
 };
 
Index: src/AST/Pass.proto.hpp
===================================================================
--- src/AST/Pass.proto.hpp	(revision ac16a55f7512bec1c4c5356fdd304e8df5883e26)
+++ src/AST/Pass.proto.hpp	(revision 69dd8e6342b54684c5b4532978f3c1537b01b01d)
@@ -40,29 +40,6 @@
 typedef std::function<void( cleanup_func_t, void * )> at_cleanup_t;
 
-// boolean reference that may be null
-// either refers to a boolean value or is null and returns true
-class bool_ref {
-public:
-	bool_ref() = default;
-	~bool_ref() = default;
-
-	operator bool() { return m_ref ? *m_ref : true; }
-	bool operator=( bool val ) { assert(m_ref); return *m_ref = val; }
-
-private:
-
-	friend class visit_children_guard;
-
-	bool * set( bool * val ) {
-		bool * prev = m_ref;
-		m_ref = val;
-		return prev;
-	}
-
-	bool * m_ref = nullptr;
-};
-
-// Implementation of the guard value
-// Created inside the visit scope
+/// Implementation of the guard value
+/// Created inside the visit scope
 class guard_value {
 public:
@@ -103,32 +80,17 @@
 public:
 
-	visit_children_guard( bool_ref * ref )
-		: m_val ( true )
-		, m_prev( ref ? ref->set( &m_val ) : nullptr )
-		, m_ref ( ref )
-	{}
+	visit_children_guard( bool * ref ) :
+		m_ref( ref ), m_val( true )
+	{
+		if ( m_ref ) { m_val = *m_ref; *m_ref = true; }
+	}
 
 	~visit_children_guard() {
-		if( m_ref ) {
-			m_ref->set( m_prev );
-		}
-	}
-
-	operator bool() { return m_val; }
+		if ( m_ref ) { *m_ref = m_val; }
+	}
 
 private:
-	bool       m_val;
-	bool     * m_prev;
-	bool_ref * m_ref;
-};
-
-/// "Short hand" to check if this is a valid previsit function
-/// Mostly used to make the static_assert look (and print) prettier
-template<typename core_t, typename node_t>
-struct is_valid_previsit {
-	using ret_t = decltype( std::declval<core_t*>()->previsit( std::declval<const node_t *>() ) );
-
-	static constexpr bool value = std::is_void< ret_t >::value ||
-		std::is_base_of<const node_t, typename std::remove_pointer<ret_t>::type >::value;
+	bool * m_ref;
+	bool   m_val;
 };
 
@@ -227,4 +189,14 @@
 		// but also contain the new values.
 	}
+};
+
+/// "Short hand" to check if this is a valid previsit function
+/// Mostly used to make the static_assert look (and print) prettier
+template<typename core_t, typename node_t>
+struct is_valid_previsit {
+	using ret_t = decltype( std::declval<core_t*>()->previsit( std::declval<const node_t *>() ) );
+
+	static constexpr bool value = std::is_void< ret_t >::value ||
+		std::is_base_of<const node_t, typename std::remove_pointer<ret_t>::type >::value;
 };
 
@@ -307,5 +279,5 @@
 FIELD_PTR( declsToAddBefore, std::list< ast::ptr< ast::Decl > > )
 FIELD_PTR( declsToAddAfter , std::list< ast::ptr< ast::Decl > > )
-FIELD_PTR( visit_children, __pass::bool_ref )
+FIELD_PTR( visit_children, bool )
 FIELD_PTR( at_cleanup, __pass::at_cleanup_t )
 FIELD_PTR( visitor, ast::Pass<core_t> * const )
