Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision e8738389410418fb54ab3de5094d7dfde4c07aa7)
+++ src/AST/Pass.impl.hpp	(revision 82f791f1d2c7e5f856d24903cbf18c05302e9ccb)
@@ -674,5 +674,5 @@
 const ast::CompoundStmt * ast::Pass< core_t >::visit( const ast::CompoundStmt * node ) {
 	VISIT_START( node );
-	VISIT({
+	VISIT(
 		// Do not enter (or leave) a new scope if atFunctionTop. Remember to save the result.
 		auto guard1 = makeFuncGuard( [this, enterScope = !this->atFunctionTop]() {
@@ -681,9 +681,9 @@
 			if ( leaveScope ) __pass::symtab::leave(core, 0);
 		});
-		ValueGuard< bool > guard2( inFunction );
+		ValueGuard< bool > guard2( atFunctionTop );
+		atFunctionTop = false;
 		guard_scope guard3 { *this };
-		inFunction = false;
 		maybe_accept( node, &CompoundStmt::kids );
-	})
+	)
 	VISIT_END( CompoundStmt, node );
 }
