IWYU (or include-what-you-use) has been released, a program that allows you to find redundant and suggest missing #includes in your C/C++ code.
"Include what you use" means that for every symbol (type, variable, function, or macro) used in foo.cc, either foo.cc or foo.h must include an .h file that exports the declaration of that symbol. The include-what-you-use tool is a program for analyzing #include source files to find violations of this approach and make recommendations for correction. The program uses the Clang libraries and usually a release means compatibility with a new version of Clang.
The main purpose of include-what-you-use is to remove unnecessary #includes. To do this, you need to figure out which #includes are not needed in a given file (for both .cc and .h), and, if possible, replace the #include with a pre-declaration.
Major changes
- Compatible with Clang 17.
- Improved analysis of type aliases (typedef and using).
- Improved analysis of namespace aliases (namespace xyz = foobar).
- Improved support for expanded forward declarations (typedef struct Foo Bar;).
- Improve handling of "autocast" and function return types, especially when working with complex template types.
- Added a new pragma IWYU: always_keep to mark a header that it should always be kept wherever it is included.
- Automatically use mappings for builtins libc++ if libc++ is the active standard library.
- Improved mappings for libc++ and posix headers.
Source: linux.org.ru
