[libcxx-commits] [libcxx] [libc++] std::atomic primary template should not have a `difference_type` member type (PR #123236)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 20 06:56:49 PST 2025


================
@@ -17,6 +17,9 @@
 //     typedef T value_type;
 // };
 
+// atomic still has a difference_type in the C++03 frozen headers
+// XFAIL: FROZEN-CXX03-HEADERS-FIXME
----------------
ldionne wrote:

libc++ was originally a library implementing the C++11 Standard even on C++03 compilers via emulation of features like move semantics. That was before move semantics and variadic templates were widely supported in compilers.

For that reason, many library features implemented early on have been "backported" to earlier standards like C++03. Since then, compilers have moved forward a lot and we've also learned that backporting features is generally not a good idea, so we don't do it anymore. But every such removal has the potential to break users, so we haven't done it for everything.

That's why we support `<atomic>` in C++03 mode as an extension.

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


More information about the libcxx-commits mailing list