[lldb] Fix -Wctad-maybe-unsupported in PathMappingList.cpp (NFC)

/home/jiefu/llvm-project/lldb/source/Target/PathMappingList.cpp:51:5: error: 'scoped_lock' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
    std::scoped_lock locks(m_mutex, rhs.m_mutex);
    ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:692:11: note: add a deduction guide to suppress this warning
    class scoped_lock
          ^
/home/jiefu/llvm-project/lldb/source/Target/PathMappingList.cpp:72:3: error: 'scoped_lock' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
  std::scoped_lock locks(m_mutex, rhs.m_mutex);
  ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:692:11: note: add a deduction guide to suppress this warning
    class scoped_lock
          ^
2 errors generated.
This commit is contained in:
Jie Fu 2023-04-21 11:59:38 +08:00
parent 950e697921
commit c5fc7809e0

View File

@ -48,7 +48,7 @@ PathMappingList::PathMappingList(const PathMappingList &rhs)
const PathMappingList &PathMappingList::operator=(const PathMappingList &rhs) {
if (this != &rhs) {
std::scoped_lock locks(m_mutex, rhs.m_mutex);
std::scoped_lock<std::recursive_mutex, std::recursive_mutex> locks(m_mutex, rhs.m_mutex);
m_pairs = rhs.m_pairs;
m_callback = nullptr;
m_callback_baton = nullptr;
@ -69,7 +69,7 @@ void PathMappingList::Append(llvm::StringRef path, llvm::StringRef replacement,
}
void PathMappingList::Append(const PathMappingList &rhs, bool notify) {
std::scoped_lock locks(m_mutex, rhs.m_mutex);
std::scoped_lock<std::recursive_mutex, std::recursive_mutex> locks(m_mutex, rhs.m_mutex);
++m_mod_id;
if (!rhs.m_pairs.empty()) {
const_iterator pos, end = rhs.m_pairs.end();