[libcxx-commits] [PATCH] D125579: [libc++] Remove overly conservative error in <stdatomic.h>

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 13 13:15:31 PDT 2022


ldionne created this revision.
ldionne added reviewers: rnk, dblaikie.
Herald added a project: All.
ldionne requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

As mentionned in D97044 <https://reviews.llvm.org/D97044>, it is fine if users include <atomic> and then
include <stdatomic.h> -- we don't need to error out for that case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125579

Files:
  libcxx/include/stdatomic.h


Index: libcxx/include/stdatomic.h
===================================================================
--- libcxx/include/stdatomic.h
+++ libcxx/include/stdatomic.h
@@ -226,14 +226,7 @@
 // the header. We do this because Clang has historically shipped a <stdatomic.h>
 // header that would be available in all Standard modes, and we don't want to
 // break that use case.
-//
-// However, if the user has already used <atomic> before, the two headers are
-// incompatible before C++23, so we issue a clear error here to avoid obscure
-// issues down the line.
 # if __has_include_next(<stdatomic.h>)
-#   ifdef _LIBCPP_ATOMIC
-#     error <stdatomic.h> is incompatible with <atomic> before C++23. Please compile with -std=c++23.
-#   endif
 #   include_next <stdatomic.h>
 # endif
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125579.429338.patch
Type: text/x-patch
Size: 782 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220513/73abea9b/attachment.bin>


More information about the libcxx-commits mailing list