Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision 6a036eb371074e8ab361d2733b169c77d8013720)
+++ src/AST/Pass.impl.hpp	(revision a2f2fda0a7a5501347525d2e999fe2d7d54e5fba)
@@ -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 );
 }
