Skip to content

Commit 934ef30

Browse files
[clang] Fix warnings
This patch fixes: clang/lib/Tooling/DependencyScanning/InProcessModuleCache.cpp:38:5: error: 'shared_lock' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported] clang/lib/Tooling/DependencyScanning/InProcessModuleCache.cpp:68:7: error: 'lock_guard' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
1 parent deb0f3c commit 934ef30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Tooling/DependencyScanning/InProcessModuleCache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ReaderWriterLock : public llvm::AdvisoryLock {
3535
// modules, so we'd typically only reach it if the owner crashed (but so did
3636
// we, since we run in the same process), or encountered deadlock.
3737
(void)MaxSeconds;
38-
std::shared_lock Lock(*OwningLock.mutex());
38+
std::shared_lock<std::shared_mutex> Lock(*OwningLock.mutex());
3939
return llvm::WaitForUnlockResult::Success;
4040
}
4141

@@ -65,7 +65,7 @@ class InProcessModuleCache : public ModuleCache {
6565

6666
std::unique_ptr<llvm::AdvisoryLock> getLock(StringRef Filename) override {
6767
auto &Mtx = [&]() -> std::shared_mutex & {
68-
std::lock_guard Lock(Mutexes.Mutex);
68+
std::lock_guard<std::mutex> Lock(Mutexes.Mutex);
6969
auto &Mutex = Mutexes.Map[Filename];
7070
if (!Mutex)
7171
Mutex = std::make_unique<std::shared_mutex>();

0 commit comments

Comments
 (0)