From a90901b7c508e35b0c7976725bb430bbe1589e9f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Jun 2026 20:01:17 +0000 Subject: [PATCH] Replace inline depth_guard struct with on_scope_exit in datatype_factory.cpp --- src/model/datatype_factory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/model/datatype_factory.cpp b/src/model/datatype_factory.cpp index fac858ccc..64f6f7367 100644 --- a/src/model/datatype_factory.cpp +++ b/src/model/datatype_factory.cpp @@ -141,7 +141,8 @@ expr * datatype_factory::get_fresh_value(sort * s) { return m_model.get_fresh_value(s); if (m_fresh_depth >= m_max_fresh_depth) return get_last_fresh_value(s); - struct depth_guard { unsigned& d; depth_guard(unsigned& d) : d(d) { ++d; } ~depth_guard() { --d; } } _dg(m_fresh_depth); + ++m_fresh_depth; + on_scope_exit _dg([&]() { --m_fresh_depth; }); TRACE(datatype, tout << "generating fresh value for: " << s->get_name() << "\n";); auto& [set, values] = get_value_set(s); // Approach 0)