[clang-tidy] Option to flag decls with internal linkage in misc-definitions-in-headers
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Currently, this seems to be intentionally left out in the current implementation.
> // internal linkage variable definitions are ignored for now.
// Although these might also cause ODR violations, we can be less certain and
// should try to keep the false-positive rate down.
Personally, I haven't really had a case where I had ODR issues with variables that have internal linkages in header files but they are hard to track as project grows and bloat binary sizes.
I assume specially making static non-const variables inline might actually change behavior in same parts but const static variables should be more safe.
https://clang.llvm.org/extra/clang-tidy/checks/misc/definitions-in-headers.html
Contributor guide
Assessment
This issue has not been assessed yet.