Index: src/AST/Decl.hpp
===================================================================
--- src/AST/Decl.hpp	(revision 24afc5313ce84b9962eaf6529d35b0fc0d0df58f)
+++ src/AST/Decl.hpp	(revision e61207e7b1f6fa896f900ac3b84bd28c9bfb5ffe)
@@ -111,5 +111,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 };
 
@@ -138,5 +138,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 };
 
@@ -201,5 +201,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 };
 
@@ -219,5 +219,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 };
 
@@ -263,5 +263,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 
 	std::string typeString() const override { return "struct"; }
@@ -281,5 +281,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 
 	std::string typeString() const override { return "union"; }
@@ -302,5 +302,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 
 	std::string typeString() const override { return "enum"; }
@@ -323,5 +323,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 
 	std::string typeString() const override { return "trait"; }
@@ -341,5 +341,5 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
+	friend node_t * mutate(const node_t * node);
 };
 
@@ -358,40 +358,6 @@
 	/// Must be copied in ALL derived classes
 	template<typename node_t>
-	friend auto mutate(const node_t * node);
-};
-
-//=================================================================================================
-/// This disgusting and giant piece of boiler-plate is here to solve a cyclic dependency
-/// remove only if there is a better solution
-/// The problem is that ast::ptr< ... > uses increment/decrement which won't work well with
-/// forward declarations
-inline void increment( const class Decl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class Decl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class DeclWithType * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class DeclWithType * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class ObjectDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class ObjectDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class FunctionDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class FunctionDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class AggregateDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class AggregateDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class StructDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class StructDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class UnionDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class UnionDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class EnumDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class EnumDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class TraitDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class TraitDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class NamedTypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class NamedTypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class TypeDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class TypeDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class TypedefDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class TypedefDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class AsmDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class AsmDecl * node, Node::ref_type ref ) { node->decrement(ref); }
-inline void increment( const class StaticAssertDecl * node, Node::ref_type ref ) { node->increment(ref); }
-inline void decrement( const class StaticAssertDecl * node, Node::ref_type ref ) { node->decrement(ref); }
+	friend node_t * mutate(const node_t * node);
+};
 
 }
