Issue 147736
Summary [C23] Clang should silently strip the `_Atomic` qualifier in enums with fixed underlying type
Labels clang
Assignees
Reporter MisterDA
    ```c
/* ISO C23 6.7.3.3-5

   The underlying type of the enumeration is the unqualified,
   non-atomic version of the type specified by the type specifiers in
   the specifier qualifier list. */

enum e : _Atomic int { E };
enum e e;

enum f : const int { F };
enum f f;
```

```
<source>:7:18: error: non-integral type '_Atomic(int)' is an invalid underlying type
    7 | enum e : _Atomic int { E };
      | ^
1 error generated.
Compiler returned: 1
```

https://godbolt.org/z/Ka35GTTEr

GCC 15 accepts this.

cc @AaronBallman 
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to