Skip to content

Commit 989f250

Browse files
committed
[lldb] 'scoped_lock' may not intend to support class template argument deduction (NFC)
/data/home/jiefu/llvm-project/lldb/source/Host/common/File.cpp:251:3: error: 'scoped_lock' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported] std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex); ^ /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:692:11: note: add a deduction guide to suppress this warning class scoped_lock ^ /data/home/jiefu/llvm-project/lldb/source/Host/common/File.cpp:316:3: error: 'scoped_lock' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported] std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex); ^ /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/mutex:692:11: note: add a deduction guide to suppress this warning class scoped_lock ^ 2 errors generated.
1 parent 69cc5a4 commit 989f250

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/source/Host/common/File.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ uint32_t File::GetPermissions(Status &error) const {
248248
}
249249

250250
bool NativeFile::IsValid() const {
251-
std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex);
251+
std::scoped_lock<std::mutex, std::mutex> lock(m_descriptor_mutex, m_stream_mutex);
252252
return DescriptorIsValidUnlocked() || StreamIsValidUnlocked();
253253
}
254254

@@ -313,7 +313,7 @@ FILE *NativeFile::GetStream() {
313313
}
314314

315315
Status NativeFile::Close() {
316-
std::scoped_lock lock(m_descriptor_mutex, m_stream_mutex);
316+
std::scoped_lock<std::mutex, std::mutex> lock(m_descriptor_mutex, m_stream_mutex);
317317

318318
Status error;
319319

0 commit comments

Comments
 (0)