Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision 637568b60bdf24177e836db017d886fcb9ea96ee)
+++ src/Common/PassVisitor.h	(revision d33bc7cf35bb09492981e1dc6d31b0c998fbf5f0)
@@ -258,8 +258,6 @@
 	~WithTypeSubstitution() = default;
 
+public:
 	TypeSubstitution * env;
-
-	template<typename pass_type>
-	friend class PassVisitor< pass_type>;
 };
 
@@ -269,9 +267,7 @@
 	~WithStmtsToAdd() = default;
 
+public:
 	std::list< Statement* > stmtsToAddBefore;
 	std::list< Statement* > stmtsToAddAfter;
-
-	template<typename pass_type>
-	friend class PassVisitor< pass_type>;
 };
 
@@ -281,8 +277,6 @@
 	~WithShortCircuiting() = default;
 
+public:
 	bool skip_children;
-
-	template<typename pass_type>
-	friend class PassVisitor< pass_type>;
 };
 
@@ -292,6 +286,8 @@
 	~WithScopes() = default;
 
+public:
 	at_cleanup_t at_cleanup;
 
+	template< typename T >
 	void GuardValue( T& val ) {
 		at_cleanup( [ val ]( void * newVal ) {
@@ -299,7 +295,4 @@
 		}, static_cast< void * >( & val ) );
 	}
-
-	template<typename pass_type>
-	friend class PassVisitor< pass_type>;
 };
 
