diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -199,6 +199,8 @@ Bug Fixes --------- +- ``stdatomic.h`` will use the internal declarations when targeting pre-C++-23 + on Windows platforms as the MSVC support requires newer C++ standard. - Correct ``_Static_assert`` to accept the same set of extended integer constant expressions as is accpted in other contexts that accept them. This fixes `Issue 57687 `_. diff --git a/clang/lib/Headers/stdatomic.h b/clang/lib/Headers/stdatomic.h --- a/clang/lib/Headers/stdatomic.h +++ b/clang/lib/Headers/stdatomic.h @@ -15,10 +15,12 @@ * * Exclude the MSVC path as well as the MSVC header as of the 14.31.30818 * explicitly disallows `stdatomic.h` in the C mode via an `#error`. Fallback - * to the clang resource header until that is fully supported. + * to the clang resource header until that is fully supported. The + * `stdatomic.h` header requires C++ 23 or newer. */ #if __STDC_HOSTED__ && \ - __has_include_next() && !(defined(_MSC_VER) && !defined(__cplusplus)) + __has_include_next() && \ + !(defined(_MSC_VER) && defined(__cplusplus) && __cplusplus < 202002L) # include_next #else