[libcxx-commits] [libcxx] [libc++] Make `_Atomic(T)` directly use an alias template (PR #168679)

Jan Schultke via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 18 10:23:36 PDT 2026


eisenwave wrote:

> How exactly are we non-conforming?

Because Clang/libc++ accepts `struct _Atomic(int) x;` without emitting a diagnostic, but this construct is ill-formed, (diagnostic required!) according to the standard, meaning that the implementation is required to diagnose it.

> As I said above, I want clarification on what the intention here was. The only information I could find on this was that it avoids a dependency on `<atomic>` somehow, which doesn't make any sense.

That is a fair point. Last I've checked with Jonathan Wakely when I reported this bug in GCC as well, they were not eager to fix it and told me that the point of the exposition-only template is just to avoid a dependency on `<atomic>`. I don't think that wording actually makes sense and it didn't seem like LWG was particularly attached to that anyway.

Merging this PR now would be a bad idea because it just creates divergence with GCC, and no one actually intended for the alias template to exist. It's just an inadvertent consequence of weird wording.

https://github.com/llvm/llvm-project/pull/168679


More information about the libcxx-commits mailing list