public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-7064] libstdc++: Allow Clang to use <stdatomic.h> before C++23 Date: Fri, 4 Feb 2022 23:51:06 +0000 (GMT) [thread overview] Message-ID: <20220204235106.BF2603858400@sourceware.org> (raw) https://gcc.gnu.org/g:0d1aabb60ec66bffbc9a3269f6ca85150f259564 commit r12-7064-g0d1aabb60ec66bffbc9a3269f6ca85150f259564 Author: Jonathan Wakely <jwakely@redhat.com> Date: Fri Feb 4 19:42:19 2022 +0000 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>. Diff: --- libstdc++-v3/include/c_compatibility/stdatomic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/include/c_compatibility/stdatomic.h b/libstdc++-v3/include/c_compatibility/stdatomic.h index 852574bd87c..95c72615b4e 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
reply other threads:[~2022-02-04 23:51 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220204235106.BF2603858400@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).