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

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 24 09:05:27 PST 2023


cor3ntin accepted this revision.
cor3ntin added a comment.
This revision is now accepted and ready to land.

Sorry it took me a while to reply to you. I think you convinced me this is fine as-is! Thanks



================
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)
----------------
aaron.ballman wrote:
> 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).
202000L is extra arbitrary, but.. there is a fixme so i guess it's fine!


================
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
----------------
aaron.ballman wrote:
> 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.
Fair enough. It's likely C++ will want to remove it too when rebased on C23 though


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