[meta] Identify include directives that are rendered unused by a patch
Categories
(Developer Infrastructure :: Source Code Analysis, task, P4)
Tracking
(Not tracked)
People
(Reporter: sg, Unassigned)
References
Details
(Keywords: meta)
It would be helpful if the reviewbot showed a warning when a patch renders an include directive unused in a modified file. Identifying such include directives could be done based on include-what-you-use. Due to the nature of include-what-you-use, this will definitely produce false negatives in the current state. But that wouldn't be a blocker for reducing the number of unnecessary include directives to some degree. However, false negatives would need to be ruled out almost entirely in order not to make this check an annoyance to developers. This will probably require some work in adding annotating include-what-you-use pragmas to the code base, and adding some postprocessing.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Note that clangd now (I think as of version 14) warns about unused includes, and there is a proposal to lift the functionality that enables this warning (called "include cleaner", in the future intended to also suggest missing headers) out of clangd and into a reusable library within LLVM; that might come in handy.
Updated•2 years ago
|
Updated•2 years ago
|
Updated•1 year ago
|
Description
•