[clang-tools-extra] c995120 - [clang-doc] Fix warnings about lock_guard

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 18:31:33 PST 2022


Author: Petr Hosek
Date: 2022-11-30T02:30:40Z
New Revision: c995120968993b09aeb138868b30348d6724efe2

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

LOG: [clang-doc] Fix warnings about lock_guard

Fixes a warning about a potentially unsupported template argument
deduction by explicitly specifying the template type in std::lock_guard.

Patch By: brettw
Differential Revision: https://reviews.llvm.org/D138961

Added: 
    

Modified: 
    clang-tools-extra/clang-doc/tool/ClangDocMain.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
index 83bfea027bbc..2ece3e4c071d 100644
--- a/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
+++ b/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp
@@ -264,13 +264,13 @@ Example usage for a project using a compile commands database:
 
       // Add a reference to this Info in the Index
       {
-        std::lock_guard Guard(IndexMutex);
+        std::lock_guard<llvm::sys::Mutex> Guard(IndexMutex);
         clang::doc::Generator::addInfoToIndex(CDCtx.Idx, Reduced.get().get());
       }
 
       // Save in the result map (needs a lock due to threaded access).
       {
-        std::lock_guard Guard(USRToInfoMutex);
+        std::lock_guard<llvm::sys::Mutex> Guard(USRToInfoMutex);
         USRToInfo[Group.getKey()] = std::move(Reduced.get());
       }
     });


        


More information about the cfe-commits mailing list