Extra Clang Tools 17.0.0git (In-Progress) Release Notes¶
- Introduction
- What’s New in Extra Clang Tools 17.0.0git?
- Major New Features
- Improvements to clangd
- Improvements to clang-doc
- Improvements to clang-query
- Improvements to clang-rename
- Improvements to clang-tidy
- Improvements to include-fixer
- Improvements to clang-include-fixer
- Improvements to modularize
- Improvements to pp-trace
- Clang-tidy Visual Studio plugin
Written by the LLVM Team
Warning
These are in-progress notes for the upcoming Extra Clang Tools 17 release. Release notes for previous releases can be found on the Download Page.
Introduction¶
This document contains the release notes for the Extra Clang Tools, part of the Clang release 17.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.
For more information about Clang or LLVM, including information about the latest release, please see the Clang Web Site or the LLVM 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.
What’s New in Extra Clang Tools 17.0.0git?¶
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.
Improvements to clang-query¶
The improvements are…
Improvements to clang-rename¶
The improvements are…
Improvements to clang-tidy¶
- 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.
New checks¶
New bugprone-multiple-new-in-one-expression check.
Finds multiple
new
operator calls in a single expression, where the allocated memory by the firstnew
may leak if the second allocation fails and throws exception.New bugprone-non-zero-enum-to-bool-conversion check.
Detect implicit and explicit casts of
enum
type intobool
whereenum
type doesn’t have a zero-value enumerator.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.
New cppcoreguidelines-avoid-capturing-lambda-coroutines check.
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.
New cppcoreguidelines-misleading-capture-default-by-value check.
Warns when lambda specify a by-value capture default and capture
this
.New cppcoreguidelines-missing-std-forward check.
Warns when a forwarding reference parameter is not forwarded within the function body.
New cppcoreguidelines-rvalue-reference-param-not-moved check.
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
LIBC_INLINE
macro.New misc-include-cleaner check.
Checks for unused and missing includes.
New modernize-type-traits check.
Converts standard library type traits of the form
traits<...>::type
andtraits<...>::value
intotraits_t<...>
andtraits_v<...>
respectively.New performance-avoid-endl check.
Finds uses of
std::endl
on streams and replaces them with'\n'
.New readability-avoid-unconditional-preprocessor-if check.
Finds code blocks that are constantly enabled or disabled in preprocessor directives by analyzing
#if
conditions, such as#if 0
and#if 1
, etc.New readability-operators-representation check.
Enforces consistent token representation for invoked binary, unary and overloaded operators in C++ code.
New check aliases¶
- New alias cert-msc24-c to bugprone-unsafe-functions was added.
- New alias cert-msc33-c to bugprone-unsafe-functions was added.
- New alias cppcoreguidelines-use-default-member-init to modernize-use-default-member-init was added.
Changes in existing checks¶
- 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
[[fallthrough]]
attribute. - Improved readability-redundant-string-cstr check to recognise
unnecessary
std::string::c_str()
andstd::string::data()
calls in arguments tostd::print
,std::format
or other functions listed in theStringParameterFunction
check option. - 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 to not emit warnings for forward declarations of functions.
- Improved bugprone-fold-init-type to handle iterators that do not define value_type type aliases.
- Improved bugprone-incorrect-roundings check by adding support for
other floating point representations in float constant like
0.5L
. - Deprecated check-local options HeaderFileExtensions and ImplementationFileExtensions in bugprone-suspicious-include check. Global options of the same name should be used instead.
- Improved bugprone-unchecked-optional-access check to properly handle calls
to
std::forward
. - 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.
- Extend bugprone-unused-return-value check to check for all functions
with specified return types using the
CheckedReturnTypes
option. - Deprecated cert-dcl21-cpp check.
- Deprecated C.48 enforcement from cppcoreguidelines-prefer-member-initializer. Please use cppcoreguidelines-use-default-member-init instead.
- 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.
- Deprecated check-local options HeaderFileExtensions in llvm-header-guard check. Global options of the same name should be used instead.
- 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.
- 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.
- In modernize-use-default-member-init count template constructors toward hand written constructors so that they are skipped if more than one exists.
- 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.
- 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 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.
- Fixed a false positive in readability-container-size-empty check when comparing
std::array
objects to default constructed ones. The behavior for this and other relevant classes can now be configured with a new option. - 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 readability-magic-numbers check, now allows for
magic numbers in type aliases such as
using
andtypedef
declarations if the newIgnoreTypeAliases
option is set to true. - Fixed a false positive in readability-misleading-indentation check when warning would
be unnecessarily emitted for template dependent
if constexpr
. - Fixed incorrect fixes in readability-redundant-declaration check when linkage
(like
extern "C"
) is explicitly specified. - Improved readability-static-accessed-through-instance check to support unscoped enumerations through instances and fixed usage of anonymous structs or classes.
- Fixed a false positive in cppcoreguidelines-slicing check when warning would be emitted in constructor for virtual base class initialization.
- Improved bugprone-use-after-move to understand that there is a sequence point between designated initializers.
- 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.
- Fixed an issue in readability-identifier-naming when specifying an empty
string for
Prefix
orSuffix
options could result in the style not being used. - Fixed an issue in google-readability-avoid-underscore-in-googletest-name when using
DISABLED_
in the test suite name. - 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 a false positive in performance-no-automatic-move when warning would be emitted for a const local variable to which NRVO is applied.
- Improved performance-no-automatic-move: warn on
const &&
constructors. - Fixed bugprone-exception-escape for coroutines where previously a warning would be emitted with coroutines throwing exceptions in their bodies.
Improvements to include-fixer¶
The improvements are…
Improvements to clang-include-fixer¶
The improvements are…
Improvements to modularize¶
The improvements are…