-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Labels
accepts-invalidlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
https://godbolt.org/z/97x9Ms8eK
#include <stdatomic.h>
struct _Atomic(int) x;This code should raise an error (or warning), but is falsely accepted by Clang.
https://eel.is/c++draft/stdatomic.h.syn specifies _Atomic as expanding to an exposition-only std-atomic alias template. This forbids the use of a struct keyword.
The bug occurs because libc++ defines _Atomic like:
#define _Atomic(_Tp) ::std::atomic<_Tp>llvm-project/libcxx/include/stdatomic.h
Lines 134 to 138 in 7c34848
| # ifdef _Atomic | |
| # undef _Atomic | |
| # endif | |
| # define _Atomic(_Tp) ::std::atomic<_Tp> |
See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122738
Metadata
Metadata
Assignees
Labels
accepts-invalidlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.