| Issue |
97947
|
| Summary |
misc-use-internal-linkage should not warn on const/constexpr variables
|
| Labels |
clang-tidy,
false-positive
|
| Assignees |
|
| Reporter |
carlosgalvezp
|
Example:
https://godbolt.org/z/PqhbTfq6f
`constexpr` implies `const`, and in C++ `const` implies internal linkage. Therefore, the check should not give a warning on const/constexpr variables. Otherwise we add redundant noise to the code by marking the variables `static` or creating an anonymous namespace just for them.
See also:
https://stackoverflow.com/questions/998425/why-does-const-imply-internal-linkage-in-c-when-it-doesnt-in-c
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs