[PATCH] D144196: [C2x] Remove the ATOMIC_VAR_INIT macro from stdatomic.h

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 21 05:43:22 PST 2023


aaron.ballman added inline comments.


================
Comment at: clang/docs/ReleaseNotes.rst:80
 
+- Removed the ``ATOMIC_VAR_INIT`` macro in C2x and later standards modes, which
+  implements `WG14 N2886 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2886.htm>`_
----------------
cor3ntin wrote:
> Just confirming we want to pluralize standards here? It kind of look weird to my non native eyes.
I'll reword it to be less awkward because I can't convince myself one way or the other. :-D


================
Comment at: clang/lib/Headers/stdatomic.h:50
+   in C2x mode; switch to the correct values once they've been published. */
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ < 202000L) ||               \
+    defined(__cplusplus)
----------------
cor3ntin wrote:
> C++ uses the date of the meeting where the change was accepted, I assume C is different?
`__STDC_VERSION__` is akin to `__cplusplus`, so it's the date of publication (which we don't have yet, which is why I'm using a placeholder).


================
Comment at: clang/lib/Headers/stdatomic.h:61
 /* ATOMIC_VAR_INIT was deprecated in C17 and C++20. */
 #pragma clang deprecated(ATOMIC_VAR_INIT)
 #endif
----------------
cor3ntin wrote:
> Should we add a message informing people it's remove in C23?
Eh, that gets annoying because it's removed in C23 but still present in C++23. I think the current wording is likely fine.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144196/new/

https://reviews.llvm.org/D144196



More information about the cfe-commits mailing list