diff --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp b/lldb/unittests/Expression/DWARFExpressionTest.cpp index 57669413ea7f0..a95456119956e 100644 --- a/lldb/unittests/Expression/DWARFExpressionTest.cpp +++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp @@ -68,9 +68,7 @@ class MockMemory { MockMemory() = default; MockMemory(Map memory) : m_memory(std::move(memory)) { // Make sure the requested memory size matches the returned value. - for (auto &kv : m_memory) { - auto &req = kv.first; - auto &bytes = kv.second; + for ([[maybe_unused]] auto &[req, bytes] : m_memory) { assert(bytes.size() == req.size); } }