https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122738

            Bug ID: 122738
           Summary: Accepts-invalid "struct _Atomic(int)" because _Atomic
                    is not defined as an alias template
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janschultke at googlemail dot com
  Target Milestone: ---

> #include <stdatomic.h>
> struct _Atomic(int) x;

This code should raise an error (or warning), but is falsely accepted by GCC.

https://eel.is/c++draft/stdatomic.h.syn specifies _Atomic as expanding to an
expositon-only "std-atomic" alias template. This forbids the use of a "struct"
keyword.

This happens because libstdc++ defines _Atomic as

> #define _Atomic(_Tp) ::std::atomic<_Tp>

Reply via email to