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

Jie Fu via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 20 21:00:48 PDT 2023


Author: Jie Fu
Date: 2023-04-21T11:59:38+08:00
New Revision: c5fc7809e05940674424aaed7dd06c6be0639864

URL: https://github.com/llvm/llvm-project/commit/c5fc7809e05940674424aaed7dd06c6be0639864
DIFF: https://github.com/llvm/llvm-project/commit/c5fc7809e05940674424aaed7dd06c6be0639864.diff

LOG: [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.

Added: 
    

Modified: 
    lldb/source/Target/PathMappingList.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Target/PathMappingList.cpp b/lldb/source/Target/PathMappingList.cpp
index 4efc0bf16c6d2..c369018122a59 100644
--- a/lldb/source/Target/PathMappingList.cpp
+++ b/lldb/source/Target/PathMappingList.cpp
@@ -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();


        


More information about the lldb-commits mailing list