[PATCH] D92886: [Sema] Warn about unused functions even when they're inline
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 8 15:47:50 PST 2020
efriedma added a comment.
I'm not sure this direction really makes sense.
There's a long history of defining utility functions in headers as "static inline". Non-static inline functions in C have confusing semantics. In C++, the semantics are less confusing, but "static inline" still isn't rare. The warning is designed to be compatible with that reality: it allows people to define "static inline" functions, and still get warnings about other functions that might be unused unintentionally. I don't think the warning is realistically usable if it doesn't allow "static inline" functions in headers.
The fact that the "inline" keyword isn't really significant on a "static inline" function doesn't necessarily mean the warning shouldn't exist in its current form.
Have you tried to see what the practical impact of this change is on real-world codebases?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92886/new/
https://reviews.llvm.org/D92886
More information about the cfe-commits
mailing list