Extra Clang Tools 18.0.0git (In-Progress) Release Notes¶
Written by the LLVM Team
These are in-progress notes for the upcoming Extra Clang Tools 18 release. Release notes for previous releases can be found on the Download Page.
This document contains the release notes for the Extra Clang Tools, part of the Clang release 18.0.0git. 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 extract variable tweak gained support for extracting lambda expressions to a variable.
A new tweak was added for turning unscoped into scoped enums.
The improvements are…
The improvements are…
Preprocessor-level module header parsing is now disabled by default due to the problems it caused in C++20 and above, leading to performance and code parsing issues regardless of whether modules were used or not. This change will impact only the following checks: modernize-replace-disallow-copy-and-assign-macro, bugprone-reserved-identifier, and readability-identifier-naming. Those checks will no longer see macros defined in modules. Users can still enable this functionality using the newly added command line option –enable-module-headers-parsing.
Remove configuration option AnalyzeTemporaryDestructors, which was deprecated since clang-tidy 16.
Improved –dump-config to print check options in alphabetical order.
Improved clang-tidy-diff.py script. It now returns exit code 1 if any clang-tidy subprocess exits with a non-zero code or if exporting fixes fails. It now accepts a directory as a value for -export-fixes to export individual yaml files for each compilation unit.
Improved run-clang-tidy.py script. It now accepts a directory as a value for -export-fixes to export individual yaml files for each compilation unit.
New bugprone-casting-through-void check.
Detects unsafe or redundant two-step casting operations involving
Detects equality comparison between pointer to member virtual function and anything other than null-pointer-constant.
New bugprone-inc-dec-in-conditions check.
Detects when a variable is both incremented/decremented and referenced inside a complex condition and suggests moving them outside to avoid ambiguity in the variable’s value.
New bugprone-incorrect-enable-if check.
Detects incorrect usages of
std::enable_ifthat don’t name the nested
Detects implicit conversions between pointers of different levels of indirection.
New bugprone-optional-value-conversion check.
Detects potentially unintentional and redundant conversions where a value is extracted from an optional-like type and then used to create a new instance of the same optional-like type.
New cppcoreguidelines-no-suspend-with-lock check.
Flags coroutines that suspend while a lock guard is in scope at the suspension point.
New misc-coroutine-hostile-raii check.
Detects when objects of certain hostile RAII types persists across suspension points in a coroutine. Such hostile types include scoped-lockable types and types belonging to a configurable denylist.
New modernize-use-constraints check.
enable_ifwith C++20 requires clauses.
New performance-enum-size check.
Recommends the smallest possible underlying type for an
enumclass based on the range of its enumerators.
Detects C++ code where a reference variable is used to extend the lifetime of a temporary object that has just been constructed.
Improved abseil-string-find-startswith check to also consider
std::basic_string_viewin addition to
Improved bugprone-assert-side-effect check to report usage of non-const
>>operators in assertions and fixed some false-positives with const operators.
Improved bugprone-dangling-handle check to support functional casting during type conversions at variable initialization, now with improved compatibility for C++17 and later versions.
Improved bugprone-lambda-function-name check by adding option IgnoreMacros to ignore warnings in macros.
Improved bugprone-non-zero-enum-to-bool-conversion check by eliminating false positives resulting from direct usage of bitwise operators.
Improved bugprone-reserved-identifier check, so that it does not warn on macros starting with underscore and lowercase letter.
Improved bugprone-sizeof-expression check diagnostics to precisely highlight specific locations, providing more accurate guidance.
Improved bugprone-unchecked-optional-access check, so that it does not crash during handling of optional values.
Improved bugprone-undefined-memory-manipulation check to support fixed-size arrays of non-trivial types.
Improved bugprone-unused-return-value check diagnostic message, added support for detection of unused results when cast to non-
voidtype. Casting to
voidno longer suppresses issues by default, control this behavior with the new AllowCastToVoid option.
Improved cppcoreguidelines-avoid-non-const-global-variables check to ignore
staticvariables declared within the scope of
Improved cppcoreguidelines-avoid-reference-coroutine-parameters check to ignore false positives related to matching parameters of non coroutine functions and increase issue detection for cases involving type aliases with references.
Improved cppcoreguidelines-narrowing-conversions check by extending the IgnoreConversionFromTypes option to include types without a declaration, such as built-in types.
Improved cppcoreguidelines-prefer-member-initializer check to ignore delegate constructors and ignore re-assignment for reference or when initialization depend on field that is initialized before.
Improved cppcoreguidelines-pro-bounds-array-to-pointer-decay check to ignore predefined expression (e.g.,
Improved cppcoreguidelines-pro-bounds-constant-array-index check to perform checks on derived classes of
Improved cppcoreguidelines-pro-type-const-cast check to ignore casts to
volatiletype (controlled by StrictMode option) and casts in implicitly invoked code.
Improved cppcoreguidelines-pro-type-member-init check to ignore dependent delegate constructors.
Improved cppcoreguidelines-pro-type-static-cast-downcast check to disregard casts on non-polymorphic types when the StrictMode option is set to false.
Improved cppcoreguidelines-pro-type-vararg check to ignore false-positives in unevaluated context (e.g.,
Improved cppcoreguidelines-rvalue-reference-param-not-moved check to ignore unused parameters when they are marked as unused and parameters of deleted functions and constructors.
Improved llvm-namespace-comment check to provide fixes for
inlinenamespaces in the same format as clang-format.
Improved llvmlibc-callee-namespace to support customizable namespace. This matches the change made to implementation in namespace.
Improved llvmlibc-implementation-in-namespace to support customizable namespace. This further allows for testing the libc when the system-libc is also LLVM’s libc.
Improved llvmlibc-inline-function-decl to properly ignore implicit functions, such as struct constructors, and explicitly deleted functions.
Improved misc-const-correctness check to avoid false positive when using pointer to member function. Additionally, the check no longer emits a diagnostic when a variable that is not type-dependent is an operand of a type-dependent binary operator.
Improved misc-include-cleaner check by adding option DeduplicateFindings to output one finding per symbol occurrence, avoid inserting the same header multiple times, fix a bug where IgnoreHeaders option won’t work with verbatim/std headers.
Improved misc-redundant-expression check to ignore false-positives in unevaluated context (e.g.,
Improved misc-unused-using-decls check to avoid false positive when using in elaborated type.
Improved modernize-avoid-bind check to not emit a
returnfor fixes when the function returns
voidand to provide valid fixes for cases involving bound C++ operators.
Improved modernize-loop-convert to support for-loops with iterators initialized by free functions like
sizeand avoid crash for array of dependent array.
Improved modernize-make-shared check to support
std::shared_ptrimplementations that inherit the
resetmethod from a base class.
Improved modernize-return-braced-init-list check to ignore false-positives when constructing the container with
countcopies of elements with value
Improved modernize-use-equals-delete check to ignore false-positives when special member function is actually used or implicit.
Improved modernize-use-nullptr check by adding option IgnoredTypes that can be used to exclude some pointer types.
Improved modernize-use-std-print check to accurately generate fixes for reordering arguments.
Improved modernize-use-using check to fix function pointer and forward declared
Improved performance-faster-string-find check to properly escape single quotes.
Improved performance-noexcept-move-constructor to better handle conditional noexcept expressions, eliminating false-positives.
Improved performance-noexcept-swap check to enforce a stricter match with the swap function signature and better handling of condition noexcept expressions, eliminating false-positives.
Improved readability-braces-around-statements check to ignore false-positive for
if constexprin lambda expression.
Improved readability-avoid-const-params-in-decls diagnositics to highlight the const location
Improved readability-container-size-empty check to detect comparison between string and empty string literals and support
length()method as an alternative to
Improved readability-function-size check configuration to use none rather than -1 to disable some parameters.
Improved readability-identifier-naming check to issue accurate warnings when a type’s forward declaration precedes its definition. Additionally, it now provides appropriate warnings for
unionin C, while also incorporating support for the
Leading_upper_snake_casenaming convention. The handling of
typedefhas been enhanced, particularly within complex types like function pointers and cases where style checks were omitted when functions started with macros. Added support for C++20
camel_Snake_Casenow detect more invalid identifier names.
Improved readability-implicit-bool-conversion check to take do-while loops into account for the AllowIntegerConditions and AllowPointerConditions options. It also now provides more consistent suggestions when parentheses are added to the return value.
Improved readability-non-const-parameter check to ignore false-positives in initializer list of record.
Improved readability-static-accessed-through-instance check to identify calls to static member functions with out-of-class inline definitions.
The improvements are…
The improvements are…
The improvements are…