Index: src/Common/CodeLocationTools.cpp
===================================================================
--- src/Common/CodeLocationTools.cpp	(revision 5541a44e408478e994f615c1c49cd87dd3547d96)
+++ src/Common/CodeLocationTools.cpp	(revision b05beaa3bbb9645409ca930f493596216e1c2c89)
@@ -208,9 +208,9 @@
 
 struct LeafKindVisitor : public ast::Visitor {
-	LeafKind kind;
+	LeafKind result;
 
 #define VISIT(node_type, return_type) \
 	const ast::return_type * visit( const ast::node_type * ) final { \
-		kind = LeafKind::node_type; \
+		result = LeafKind::node_type; \
 		return nullptr; \
 	}
@@ -222,7 +222,5 @@
 
 LeafKind get_leaf_kind( ast::Node const * node ) {
-	LeafKindVisitor visitor;
-	node->accept( visitor );
-	return visitor.kind;
+	return ast::Pass<LeafKindVisitor>::read( node );
 }
 
