Skip to content

Commit 6f1013a

Browse files
authored
[libc] Add template deduction guide for cpp::lock_guard. (#91589)
Fix ctad-maybe-unsupported warnings for `cpp::lock_guard`.
1 parent e88ba6d commit 6f1013a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc/src/__support/CPP/mutex.h

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ template <typename MutexType> class lock_guard {
4040
lock_guard(const lock_guard &) = delete;
4141
};
4242

43+
// Deduction guide for lock_guard to suppress CTAD warnings.
44+
template <typename T> lock_guard(T &) -> lock_guard<T>;
45+
4346
} // namespace cpp
4447
} // namespace LIBC_NAMESPACE
4548

0 commit comments

Comments
 (0)