diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-02-04 19:42:19 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-02-04 19:51:26 +0000 |
commit | 0d1aabb60ec66bffbc9a3269f6ca85150f259564 (patch) | |
tree | a0ee3a7c4e59061652ce3da128d50659e61d6b2c | |
parent | da72e0fd20f87bb523a81a505c00546d3622e9dd (diff) | |
download | gcc-0d1aabb60ec66bffbc9a3269f6ca85150f259564.zip gcc-0d1aabb60ec66bffbc9a3269f6ca85150f259564.tar.gz gcc-0d1aabb60ec66bffbc9a3269f6ca85150f259564.tar.bz2 |
libstdc++: Allow Clang to use <stdatomic.h> before C++23
There is code that only expects to be compiled with clang++ and uses its
<stdatomic.h>, which works because Clang supports the _Atomic specifier
in C++. The addition of <stdatomic.h> to libstdc++ broke this code, as
now it finds the C++ header instead, which is empty for any standard
mode before C++23.
This change allows that code to keep working as before, by forwarding to
clang's <stdatomic.h>.
libstdc++-v3/ChangeLog:
* include/c_compatibility/stdatomic.h [__clang__]: Use
#include_next <stdatomic.h>.
-rw-r--r-- | libstdc++-v3/include/c_compatibility/stdatomic.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/c_compatibility/stdatomic.h b/libstdc++-v3/include/c_compatibility/stdatomic.h index 852574b..95c7261 100644 --- a/libstdc++-v3/include/c_compatibility/stdatomic.h +++ b/libstdc++-v3/include/c_compatibility/stdatomic.h @@ -120,5 +120,7 @@ using std::atomic_flag_clear_explicit; using std::atomic_thread_fence; using std::atomic_signal_fence; +#elif defined __clang__ +# include_next <stdatomic.h> #endif // C++23 #endif // _GLIBCXX_STDATOMIC_H |