Extra Clang Tools 23.0.0git (In-Progress) Release Notes¶
Written by the LLVM Team
Warning
These are in-progress notes for the upcoming Extra Clang Tools 23 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 23.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 23.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.
Major New Features¶
Potentially Breaking Changes¶
Improvements to clangd¶
Inlay hints¶
Diagnostics¶
Semantic Highlighting¶
Compile flags¶
Hover¶
Code completion¶
Now also provides include files without extension, if they are in a directory only called
include.
Code actions¶
Signature help¶
Cross-references¶
Objective-C¶
Miscellaneous¶
Improvements to clang-doc¶
Improvements to clang-query¶
Improvements to clang-tidy¶
Improved check_clang_tidy.py script by adding the -check-header argument to simplify testing of header files. This argument automatically manages the creation of temporary header files and ensures that diagnostics and fixes are verified for the specified headers.
New checks¶
New bugprone-unsafe-to-allow-exceptions check.
Finds functions where throwing exceptions is unsafe but the function is still marked as potentially throwing.
New llvm-type-switch-case-types check.
Finds
llvm::TypeSwitch::Casecalls with redundant explicit template arguments that can be inferred from the lambda parameter type.New llvm-use-vector-utils check.
Finds calls to
llvm::to_vector(llvm::map_range(...))andllvm::to_vector(llvm::make_filter_range(...))that can be replaced withllvm::map_to_vectorandllvm::filter_to_vector.New modernize-use-string-view check.
Looks for functions returning
std::[w|u8|u16|u32]stringand suggests to change it tostd::[...]string_viewfor performance reasons if possible.New modernize-use-structured-binding check.
Finds places where structured bindings could be used to decompose pairs and suggests replacing them.
New performance-string-view-conversions check.
Finds and removes redundant conversions from
std::[w|u8|u16|u32]string_viewtostd::[...]stringin call expressions expectingstd::[...]string_view.New performance-use-std-move check.
Suggests insertion of
std::move(...)to turn copy assignment operator calls into move assignment ones, when deemed valid and profitable.New readability-trailing-comma check.
Checks for presence or absence of trailing commas in enum definitions and initializer lists.
New check aliases¶
Renamed hicpp-ignored-remove-result to bugprone-unused-return-value. The hicpp-ignored-remove-result name is kept as an alias.
Renamed hicpp-no-assembler to portability-no-assembler. The hicpp-no-assembler name is kept as an alias.
Changes in existing checks¶
Improved bugprone-argument-comment to also check for C++11 inherited constructors.
Improved bugprone-bad-signal-to-kill-thread check by fixing false negatives when the
SIGTERMmacro is obtained from a precompiled header.Improved bugprone-casting-through-void check by running only on C++ files because suggested
reinterpret_castis not available in pure C.Improved bugprone-exception-escape check by adding TreatFunctionsWithoutSpecificationAsThrowing option to support reporting for unannotated functions, enabling reporting when no explicit
throwis seen and allowing separate tuning for known and unknown implementations.Improved bugprone-fold-init-type check by detecting precision loss in overloads with transparent standard functors (e.g.
std::plus<>) forstd::accumulate,std::reduce, andstd::inner_product.Improved bugprone-macro-parentheses check by printing the macro definition in the warning message if the macro is defined on command line.
Improved bugprone-std-namespace-modification check by fixing false positives when extending the standard library with a specialization of user-defined type.
Improved bugprone-string-constructor check to detect suspicious string constructor calls when the string class constructor has a default allocator argument.
Improved bugprone-unsafe-functions check by adding the function
std::get_temporary_bufferto the default list of unsafe functions. (This function is unsafe, useless, deprecated in C++17 and removed in C++20).Improved bugprone-use-after-move check by including the name of the invalidating function in the warning message when a custom invalidation function is used (via the InvalidationFunctions option).
Improved cppcoreguidelines-init-variables check by ensuring that member pointers are correctly flagged as uninitialized.
Improved cppcoreguidelines-missing-std-forward check by fixing a false positive for constrained template parameters.
Improved cppcoreguidelines-pro-type-vararg check by no longer warning on builtins with custom type checking (e.g., type-generic builtins like
__builtin_clzg) that use variadic declarations as an implementation detail.Improved llvm-use-ranges check by adding support for the following algorithms:
std::accumulate,std::replace_copy, andstd::replace_copy_if.Improved misc-const-correctness check:
Added support for analyzing function parameters with the AnalyzeParameters option.
Fixed false positive where an array of pointers to
constwas incorrectly diagnosed as allowing the pointee to be madeconst.
Improved misc-throw-by-value-catch-by-reference check:
Fixed the WarnOnLargeObject option to use the correct name when storing the configuration.
Fixed the CheckThrowTemporaries option to correctly reflect its configured value in exported settings.
Improved misc-unused-using-decls to not diagnose
usingdeclarations as unused if they’re exported from a module.Improved modernize-pass-by-value check by adding IgnoreMacros option to suppress warnings in macros.
Improved modernize-redundant-void-arg check to work in C23.
Improved modernize-use-equals-delete check by only warning on private deleted functions, if they do not have a public overload or are a special member function.
Improved modernize-use-std-format check by fixing a crash when an argument is part of a macro expansion.
Improved modernize-use-using check by avoiding the generation of invalid code for function types with redundant parentheses.
Improved performance-enum-size check:
Exclude
enuminextern "C"blocks.Improved the ignore list to correctly handle
typedefandenum.
Improved performance-faster-string-find check:
Now analyzes calls to the
starts_with,ends_with,contains, andoperator+=string member functions.Fixes false negatives when using
std::setfromlibstdc++.
Improved performance-inefficient-vector-operation check by correctly handling vector-like classes when
push_back/emplace_backare inherited.Improved performance-move-const-arg check by avoiding false positives on trivially copyable types with a non-public copy constructor.
Improved readability-container-size-empty check by fixing a crash when a member expression has a non-identifier name.
Improved readability-else-after-return check:
Fixed missed diagnostics when
ifstatements appear in unbracedswitchcase labels.Added support for handling attributed
ifthen-branches such as[[likely]]and[[unlikely]].
Improved readability-enum-initial-value check: the warning message now uses separate note diagnostics for each uninitialized enumerator, making it easier to see which specific enumerators need explicit initialization.
Improved readability-non-const-parameter check by avoiding false positives on parameters used in dependent expressions (e.g. inside generic lambdas).
Improved readability-redundant-preprocessor check by fixing a false positive for nested
#ifdirectives using different builtin expressions such as__has_builtinand__has_cpp_attribute.Improved readability-simplify-boolean-expr check to provide valid fix suggestions for C23 and later by not using
static_cast.Improved readability-simplify-subscript-expr check by fixing missing warnings when subscripting an object held inside a generic container (e.g. subscripting a
std::stringheld inside astd::vector<std::string>).Improved readability-suspicious-call-argument check by avoiding a crash from invalid
Abbreviationsoption.