[libcxx-commits] [libcxx] [libc++] protect absent atomic types with ifdef (PR #82351)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 20 04:27:06 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Dominik Wójt (domin144)

<details>
<summary>Changes</summary>

Otherwise modules.std-module.sh.cpp test fails with following error:
    error: no member named 'atomic_signed_lock_free' in namespace 'std'
when the types are not available.

---
Full diff: https://github.com/llvm/llvm-project/pull/82351.diff


1 Files Affected:

- (modified) libcxx/modules/std/atomic.inc (+2) 


``````````diff
diff --git a/libcxx/modules/std/atomic.inc b/libcxx/modules/std/atomic.inc
index 88b31ccdb20840..2b54cef863e571 100644
--- a/libcxx/modules/std/atomic.inc
+++ b/libcxx/modules/std/atomic.inc
@@ -111,8 +111,10 @@ export namespace std {
   using std::atomic_uintmax_t;
   using std::atomic_uintptr_t;
 
+#ifndef _LIBCPP_NO_LOCK_FREE_TYPES
   using std::atomic_signed_lock_free;
   using std::atomic_unsigned_lock_free;
+#endif
 
   // [atomics.flag], flag type and operations
   using std::atomic_flag;

``````````

</details>


https://github.com/llvm/llvm-project/pull/82351


More information about the libcxx-commits mailing list