Extra Clang Tools 17.0.1 Release Notes¶
Written by the LLVM Team
This document contains the release notes for the Extra Clang Tools, part of the Clang release 17.0.1. Here we describe the status of the Extra Clang Tools in some detail, including major improvements from the previous release and new feature work. All LLVM releases may be downloaded from the LLVM releases web site.
Note that if you are reading this file from a Git checkout or the main Clang web page, this document applies to the next release, not the current one. To see the release notes for a specific release, please see the releases page.
Some of the major new features and improvements to Extra Clang Tools are listed here. Generic improvements to Extra Clang Tools as a whole or to its underlying infrastructure are described first, followed by tool-specific sections.
The improvements are…
The improvements are…
New global configuration file options HeaderFileExtensions and ImplementationFileExtensions, replacing the check-local options of the same name.
Support specifying Checks as a YAML list in the .clang-tidy configuration file.
Fix a potential crash when using the –dump-config option.
Support specifying SystemHeaders in the .clang-tidy configuration file, with the same functionality as the command-line option –system-headers.
WarningsAsErrors (–warnings-as-errors=) no longer promotes unlisted warnings to errors. Only the warnings listed in Checks (–checks=) will be promoted to errors. For custom error promotion, use -Werror=<warning> on the compiler command-line, irrespective of Checks (–checks=) settings.
Fixed an issue where compiler warnings couldn’t be suppressed using -Wno-<warning> under C++20 and above.
New bugprone-empty-catch check.
Detects and suggests addressing issues with empty catch statements.
New bugprone-multiple-new-in-one-expression check.
newoperator calls in a single expression, where the allocated memory by the first
newmay leak if the second allocation fails and throws exception.
New bugprone-non-zero-enum-to-bool-conversion check.
Detect implicit and explicit casts of
enumtype doesn’t have a zero-value enumerator.
New bugprone-switch-missing-default-case check.
Ensures that switch statements without default cases are flagged, focuses only on covering cases with non-enums where the compiler may not issue warnings.
New bugprone-unique-ptr-array-mismatch check.
Finds initializations of C++ unique pointers to non-array type that are initialized with an array.
New bugprone-unsafe-functions check.
Checks for functions that have safer, more secure replacements available, or are considered deprecated due to design flaws. This check relies heavily on, but is not exclusive to, the functions from the Annex K. “Bounds-checking interfaces” of C11.
Flags C++20 coroutine lambdas with non-empty capture lists that may cause use-after-free errors and suggests avoiding captures or ensuring the lambda closure object has a guaranteed lifetime.
Warns when lambda specify a by-value capture default and capture
New cppcoreguidelines-missing-std-forward check.
Warns when a forwarding reference parameter is not forwarded within the function body.
Warns when an rvalue reference function parameter is never moved within the function body.
New llvmlibc-inline-function-decl check.
Checks that all implicit and explicit inline functions in header files are tagged with the
New misc-header-include-cycle check.
Check detects cyclic
#includedependencies between user-defined headers.
New misc-include-cleaner check.
Checks for unused and missing includes.
New modernize-type-traits check.
Converts standard library type traits of the form
New modernize-use-std-print check.
Converts calls to
absl::FPrintfor other functions via configuration options, to equivalent calls to C++23’s
std::println, or other functions via a configuration option, modifying the format string appropriately and removing now-unnecessary calls to
New performance-avoid-endl check.
Finds uses of
std::endlon streams and replaces them with
New performance-noexcept-destructor check.
Finds user declared destructors which are not
New performance-noexcept-swap check.
Finds user declared swap functions which are not
Finds code blocks that are constantly enabled or disabled in preprocessor directives by analyzing
#ifconditions, such as
#if 1, etc.
New readability-operators-representation check.
Enforces consistent token representation for invoked binary, unary and overloaded operators in C++ code.
Fixed false-positives in bugprone-branch-clone check by ignoring auto-generated code, template instances, implicit code patterns and duplicated switch cases marked with the
Improved bugprone-dangling-handle check enhancing detection of handles behind type aliases.
Deprecated check-local options HeaderFileExtensions in bugprone-dynamic-static-initializers check. Global options of the same name should be used instead.
Improved bugprone-exception-escape check to not emit warnings for forward declarations of functions, explicitly declared throwing functions, coroutines throwing exceptions in their bodies and skip
noexceptfunctions during call stack analysis.
Improved bugprone-fold-init-type to handle iterators that do not define value_type type aliases.
Improved bugprone-forwarding-reference-overload check to ignore constructors with associated constraints (C++ concepts).
Improved bugprone-incorrect-roundings check by adding support for other floating point representations in float constant like
Improved the performance of the bugprone-reserved-identifier check through optimizations.
Improved the bugprone-reserved-identifier check by enhancing the AllowedIdentifiers option to support regular expressions.
Deprecated check-local options HeaderFileExtensions and ImplementationFileExtensions in bugprone-suspicious-include check. Global options of the same name should be used instead.
Improved bugprone-too-small-loop-variable check. Basic support for bit-field and integer members as a loop variable or upper limit were added.
Improved bugprone-unchecked-optional-access check to properly handle calls to
std::forwardand support for
Extend bugprone-unused-return-value check to check for all functions with specified return types using the
Improved bugprone-use-after-move check. Detect uses and moves in constructor initializers. Correctly handle constructor arguments as being sequenced when constructor call is written as list-initialization. Understand that there is a sequence point between designated initializers.
Improved bugprone-swapped-arguments by enhancing handling of implicit conversions, resulting in better detection of argument swaps involving integral and floating-point types.
Deprecated cert-dcl21-cpp check.
Fixed cppcoreguidelines-avoid-const-or-ref-data-members check to emit warnings only on classes that are copyable/movable, as required by the corresponding rule.
Improved cppcoreguidelines-owning-memory check now finds more issues, especially those related to implicit casts.
Improved cppcoreguidelines-pro-bounds-constant-array-index check to cover type aliases of
Fixed a false positive in cppcoreguidelines-slicing check when warning would be emitted in constructor for virtual base class initialization.
Deprecated check-local options HeaderFileExtensions in google-build-namespaces check. Global options of the same name should be used instead.
Deprecated check-local options HeaderFileExtensions in google-global-names-in-headers check. Global options of the same name should be used instead.
Fixed an issue in google-readability-avoid-underscore-in-googletest-name when using
DISABLED_in the test suite name.
Deprecated check-local options HeaderFileExtensions in llvm-header-guard check. Global options of the same name should be used instead.
Fix false positive in llvmlibc-inline-function-decl when using templated function with separate declarations and definitions.
Improved the performance of the misc-confusable-identifiers check through optimizations.
Deprecated check-local options HeaderFileExtensions in misc-definitions-in-headers check. Global options of the same name should be used instead.
Fixed false positive in misc-definitions-in-headers to avoid warning on declarations inside anonymous namespaces.
Fixed false-positive in misc-redundant-expression check where expressions like
sizeofwere incorrectly flagged as identical.
Improved misc-unused-parameters check with new IgnoreVirtual option to optionally ignore virtual methods.
Deprecated check-local options HeaderFileExtensions in misc-unused-using-decls check. Global options of the same name should be used instead.
Improved modernize-concat-nested-namespaces to fix incorrect fixes when using macro between namespace declarations, to fix false positive when using namespace with attributes and to support nested inline namespace introduced in c++20.
Fixed an issue in modernize-loop-convert generating wrong code when using structured bindings.
In modernize-use-default-member-init check, template constructors are now counted towards hand-written constructors and skipped if more than one exists. Additionally, a crash that occurred with array members being value-initialized has been fixed.
Fixed false positive in modernize-use-equals-default check for special member functions containing macros or preprocessor directives, and out-of-line special member functions in unions.
Improved modernize-use-override check with new IgnoreTemplateInstantiations option to optionally ignore virtual function overrides that are part of template instantiations.
Improved performance-for-range-copy check by extending const usage analysis to include the type’s members.
Improved performance-inefficient-vector-operation check by extending const usage analysis to include the type’s members.
Improved performance-move-const-arg check to warn when move special member functions are not available.
Improved performance-no-automatic-move check to warn on
const &&constructors and ignore
constlocal variable to which NRVO is applied.
Fixed an issue in the performance-noexcept-move-constructor checker that was causing false-positives when the move constructor or move assign operator were defaulted.
Improved performance-unnecessary-copy-initialization check by extending const usage analysis to include the type’s members.
Improved performance-unnecessary-value-param check by extending const usage analysis to include the type’s members.
Improved readability-container-data-pointer check with new IgnoredContainers option to ignore some containers.
Fixed a false positive in readability-container-size-empty check when comparing
std::arrayobjects to default constructed ones. The behavior for this and other relevant classes can now be configured with a new option.
Fixed a false negative in readability-convert-member-functions-to-static when a nested class in a member function uses a
Fixed reading HungarianNotation.CString.* options in readability-identifier-naming check.
Renamed HungarianNotation.CString options CharPrinter and WideCharPrinter to CharPointer and WideCharPointer respectively in readability-identifier-naming check.
Updated the Hungarian prefixes for enums in C files to match those used in C++ files for improved readability, as checked by readability-identifier-naming. To preserve the previous behavior of using i as the prefix for enum tags, set the EnumConstantPrefix option to i instead of using EnumConstantHungarianPrefix.
Fixed a hungarian notation issue in readability-identifier-naming which failed to indicate the number of asterisks.
Fixed an issue in readability-identifier-naming when specifying an empty string for Prefix or Suffix options could result in the style not being used.
Improved the performance of the readability-identifier-naming check through optimizations.
Fixed a false positive in readability-implicit-bool-conversion check warning would be unnecessarily emitted for explicit cast using direct list initialization.
Added support to optionally ignore user-defined literals in readability-magic-numbers check and improved it to allow magic numbers in type aliases such as
typedefdeclarations if the new IgnoreTypeAliases option is set to true.
Fixed a false positive in readability-misleading-indentation check when warning would be unnecessarily emitted for template dependent
Fixed a false positive in readability-named-parameter for defaulted out-of-line special member functions.
Fixed incorrect fixes in readability-redundant-declaration check when linkage (like
extern "C") is explicitly specified.
Improved readability-redundant-string-cstr check to recognise unnecessary
std::string::data()calls in arguments to
std::formator other functions listed in the StringParameterFunction check option.
Improved readability-static-accessed-through-instance check to support unscoped enumerations through instances and fixed usage of anonymous structs or classes.
The improvements are…
The improvements are…
The improvements are…