Skip to content

[libc++] protect absent atomic types with ifdef #82351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

domin144
Copy link
Contributor

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.

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.
@domin144 domin144 requested a review from a team as a code owner February 20, 2024 12:26
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Feb 20, 2024
@llvmbot
Copy link
Member

llvmbot commented Feb 20, 2024

@llvm/pr-subscribers-libcxx

Author: Dominik Wójt (domin144)

Changes

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 --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;

@domin144
Copy link
Contributor Author

@ldionne @mordante
(I can't request review through github, yet.)

@domin144 domin144 merged commit c19a819 into llvm:main Feb 27, 2024
@domin144 domin144 deleted the libcxx_protect_atomics_with_ifdef branch February 27, 2024 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants