cppclean
C++ unused code and header finder
TLDR
SYNOPSIS
cppclean [options] paths...
DESCRIPTION
cppclean finds problems in C++ source that slow development in large code bases, including various forms of unused code. It detects unnecessary #include directives in header files, unused forward declarations, functions declared but not defined, and classes with virtual methods but no virtual destructor.
The tool identifies which headers can be safely removed, reducing compilation dependencies and speeding up incremental builds. It also detects inconsistent casing in #include paths (e.g., `foo.h` vs `Foo.h`) and global/static data that may cause problems with threads.
PARAMETERS
--include-path path
Additional include search path (like gcc -I). Can be specified multiple times. Not recursive.--verbose
Enable verbose output for debugging.--quiet
Suppress output messages.
CAVEATS
May report false positives for conditionally compiled code (e.g., `#ifdef` blocks). Results should be verified before removing includes. Detection of unnecessary includes in source files (not headers) is limited.
SEE ALSO
clang-tidy(1), gcc(1), cmake(1)

