[libcxx-commits] [libcxx] [libc++] Don't implement <stdatomic.h> before C++23 (PR #123130)

Hans Wennborg via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 23 07:57:37 PST 2025


zmodem wrote:

Still debugging, but I wanted to give a heads up that we're hitting build issues after this, e.g.

```
../../third_party/libc++/src/include/__memory/shared_ptr.h:1496:35: error: expected expression
 1496 | inline _LIBCPP_HIDE_FROM_ABI bool atomic_is_lock_free(const shared_ptr<_Tp>*) {
      |                                   ^
../../third_party/llvm-build/Release+Asserts/lib/clang/20/include/stdatomic.h:90:73: note: expanded from macro 'atomic_is_lock_free'
   90 | #define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj)))
```

I think that before this change, we got the `atomic_is_lock_free` definition from `libcxx/include/stdatomic.h`, which is a template, but now the `#include_next` is giving us clang's `clang/lib/Headers/stdatomic.h` which defines the macro instead.

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


More information about the libcxx-commits mailing list