| Issue |
61660
|
| Summary |
Clang suggests wrong attribute placement for enum classes
|
| Labels |
good first issue,
clang:diagnostics
|
| Assignees |
|
| Reporter |
tbaederr
|
Consider this code:
```c++
__attribute__((deprecated))
enum class F {
Foo,
Bar
};
```
clang suggests:
```console
<source>:3:16: warning: attribute 'deprecated' is ignored, place it after "enum" to apply attribute to type declaration [-Wignored-attributes]
__attribute__((deprecated))
```
Godbolt: https://godbolt.org/z/E4vT1dc57
But placing them after "enum" is wrong, too:
```console
<source>:4:6: error: an attribute list cannot appear here
enum __attribute__((deprecated)) class F {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Godbolt: https://godbolt.org/z/PWvd8jsr5
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs