Created on 2026-06-18.00:00:00 last changed 5 days ago
Proposed resolution:
This wording is relative to N5046.
Modify [stdatomic.h.syn], header <stdatomic.h> synopsis, as indicated:
template<class T> using std-atomic = std::atomic<T>; // exposition only#define _Atomic(T)std-atomic<T>std::atomic<T>;
[ 2026-08-27; Reflector poll. ]
Set priority to 4 after reflector poll.
Many voted NAD, arguing the alias template serves a purpose (prevents lookup problems in nested namespaces and communicates that std::atomic need not be visible from <stdatomic.h>).
Possible improvement would be to use:
template<class T> using std-atomic = see below;and then say that it's an unspecified type alias that denotes the same type as std::atomic<T>.
Consider the following example:
#include <stdatomic.h> struct _Atomic(int) x; // MSVC rejects, GCC and Clang accept
GCC and Clang incorrectly accept this example because they expand the `_Atomic` macro directly to `std::atomic` instead of the exposition-only std-atomic alias template ([stdatomic.h.syn]), which allows the use of a preceding `struct` keyword.
While the wording is clear, the exposition-only std-atomic alias template causes disagreement among implementers (see discussion at here and here). P0943R6 never actually intended for an alias template to exist as part of its design. The alias template is intended to hint that the expansion of the `_Atomic` macro to `std::atomic` does not require an inclusion of the <atomic> header. However, `std::atomic` still appears directly inside the <stdatomic.h> synopsis, so it is unclear how std-atomic contributes to that goal.| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-09-10 14:03:08 | admin | set | messages: + msg16594 |
| 2026-06-20 12:50:41 | admin | set | messages: + msg16492 |
| 2026-06-18 00:00:00 | admin | create | |