[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
This commit is contained in:
Petr Hosek 2022-11-30 02:30:40 +00:00
parent f297332749
commit c995120968
1 changed files with 2 additions and 2 deletions

View File

@ -264,13 +264,13 @@ Example usage for a project using a compile commands database:
// Add a reference to this Info in the Index // 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()); clang::doc::Generator::addInfoToIndex(CDCtx.Idx, Reduced.get().get());
} }
// Save in the result map (needs a lock due to threaded access). // 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()); USRToInfo[Group.getKey()] = std::move(Reduced.get());
} }
}); });