[libc-commits] [libc] 6f1013a - [libc] Add template deduction guide for cpp::lock_guard. (#91589)

via libc-commits libc-commits at lists.llvm.org
Thu May 9 06:31:10 PDT 2024


Author: lntue
Date: 2024-05-09T09:31:06-04:00
New Revision: 6f1013a5b3f92d3ae6e378d6706584a2a44e6964

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

LOG: [libc] Add template deduction guide for cpp::lock_guard. (#91589)

Fix ctad-maybe-unsupported warnings for `cpp::lock_guard`.

Added: 
    

Modified: 
    libc/src/__support/CPP/mutex.h

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/CPP/mutex.h b/libc/src/__support/CPP/mutex.h
index 345816fae2336..ff9c9f43a43cc 100644
--- a/libc/src/__support/CPP/mutex.h
+++ b/libc/src/__support/CPP/mutex.h
@@ -40,6 +40,9 @@ template <typename MutexType> class lock_guard {
   lock_guard(const lock_guard &) = delete;
 };
 
+// Deduction guide for lock_guard to suppress CTAD warnings.
+template <typename T> lock_guard(T &) -> lock_guard<T>;
+
 } // namespace cpp
 } // namespace LIBC_NAMESPACE
 


        


More information about the libc-commits mailing list