[PATCH] D92886: [Sema] Warn about unused functions even when they're inline

2020-12-09 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added a comment. In D92886#2443176 , @aaronpuchert wrote: >> Non-static inline functions in C have confusing semantics. > > I'm not terribly familiar with C, but judging from C11 6.7.4 it seems that C > is a bit more permissive, but then say

[PATCH] D92886: [Sema] Warn about unused functions even when they're inline

2020-12-09 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert added a comment. In D92886#2441290 , @Quuxplusone wrote: > I agree with your reasoning, but in practice I still see a lot of people > using `static inline` for functions (especially function templates) in .h > files. That's also what I was

[PATCH] D92886: [Sema] Warn about unused functions even when they're inline

2020-12-08 Thread Eli Friedman via Phabricator via cfe-commits
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 ra

[PATCH] D92886: [Sema] Warn about unused functions even when they're inline

2020-12-08 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added subscribers: mpark, Quuxplusone. Quuxplusone added a comment. I agree with your reasoning, but in practice I still see a lot of people using `static inline` for functions (especially function templates) in .h files. I'm not sure exactly why — maybe to reduce the burden on the l

[PATCH] D92886: [Sema] Warn about unused functions even when they're inline

2020-12-08 Thread Aaron Puchert via Phabricator via cfe-commits
aaronpuchert created this revision. aaronpuchert added reviewers: aaron.ballman, efriedma, rsmith. aaronpuchert requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Being inline doesn't change anything about a function having internal linkage, s