IWYU 0.21

The IWYU (or include-what-you-use) release has arrived, a program that allows you to find redundant and suggest missing #include statements in your C/C++ code.

"Include what you use" means that for each symbol (type, variable, function, or macro) used in foo.cc, either foo.cc or foo.h must include the .h file that exports the declaration of that symbol. The include-what-you-use tool is a program designed to analyze the #include directives in source files to identify violations of this approach and provide recommendations for correction. It utilizes Clang libraries and typically indicates compatibility with the latest version of Clang.

The main goal of include-what-you-use is to remove unnecessary #include directives. To achieve this, it’s necessary to determine which #include statements are unnecessary in a given file (both for .cc and .h) and to replace #include with forward declarations when possible.

Key changes

  • Compatibility with Clang 17.
  • Improved analysis of type aliases (typedef and using).
  • Improved analysis of namespace aliases (namespace xyz = foobar).
  • Enhanced support for expanded forward declarations (typedef struct Foo Bar;).
  • Improved handling of 'auto-casting' and function return types, especially when dealing with complex template types.
  • A new IWYU pragma has been added: always_keep, which marks a header as one that should always be kept, regardless of where it is included.
  • Automatic use of matches for libc++ builtins if libc++ is the active standard library.
  • Improved matches for libc++ and posix headers.

Source: linux.org.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster