[libcxx-commits] [libcxx] [libc++][Android] Always redirect <stdatomic.h> to <atomic> (PR #143036)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 12 09:09:46 PDT 2025


https://github.com/ldionne commented:

I do have a bit of a concern with making this part of upstream: that makes libc++ non-conforming in pre-C++23 modes (in particular, `libcxx/test/libcxx/atomics/stdatomic.h.syn/dont_hijack_header.cxx23.compile.pass.cpp` doesn't pass).

Have you folks looked into removing that historical extension on the Android side? If that's something Android would be open to, I could suggest the following:
- We take this patch and upstream your support, but we also add a deprecation warning and a release note that this will be dropped in the future
- In 1-2 releases (there's flexibility here), we remove the extension, while optionally providing an escape hatch to bring it back.
- After one more release, we remove the escape hatch.

That solution:
- Gives plenty of time for Android users to migrate / fix their code (between 1 year and 1.5 years)
- Allows Android to upstream this diff
- Allows libc++ to eventually drop this debt and ensure conformance on all platforms, like we aim to

Would something like this be reasonable from Android's side?

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


More information about the libcxx-commits mailing list