| Issue |
76136
|
| Summary |
modernize-macro-to-enum should not warn when only 1 constant is created
|
| Labels |
clang-tidy,
false-positive
|
| Assignees |
|
| Reporter |
carlosgalvezp
|
Consider the following code:
```
#define FOO (123)
```
clang-tidy will trigger modernize-macro-to-enum here:
https://godbolt.org/z/T4qvMhs7q
I believe this is incorrect advice - the better fix is to simply create a constexpr constant. Enums make sense when you have multiple related constants, but when it's only one constant users should not turn it into an enum.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs