mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-27 15:28:03 +00:00
The compiled-out ScopedActivation, SpanGuard and ScopedSpanGuard each used a defaulted destructor. A defaulted destructor on an empty class is trivial, so compilers report any guard held only for its scope as an unused variable. With telemetry compiled out that produced seven -Wunused-variable errors under -Werror, across the ledger acquire, consensus, ledger master and overlay paths. Write the three destructors by hand so destruction is not trivial, matching the telemetry-enabled types, and assert that property so it cannot quietly regress to `= default`. The bodies are empty, so no code is generated either way. Also move <memory> inside the telemetry guard: only the telemetry-enabled types hold a unique_ptr, so the include is unused when telemetry is compiled out.