| 1 |
==================================================== |
| 2 |
Extra Clang Tools |release| |ReleaseNotesTitle| |
| 3 |
==================================================== |
| 4 |
|
| 5 |
.. contents:: |
| 6 |
:local: |
| 7 |
:depth: 3 |
| 8 |
|
| 9 |
Written by the `LLVM Team <https://llvm.org/>`_ |
| 10 |
|
| 11 |
.. only:: PreRelease |
| 12 |
|
| 13 |
.. warning:: |
| 14 |
These are in-progress notes for the upcoming Extra Clang Tools |version| release. |
| 15 |
Release notes for previous releases can be found on |
| 16 |
`the Download Page <https://releases.llvm.org/download.html>`_. |
| 17 |
|
| 18 |
Introduction |
| 19 |
============ |
| 20 |
|
| 21 |
This document contains the release notes for the Extra Clang Tools, part of the |
| 22 |
Clang release |release|. Here we describe the status of the Extra Clang Tools in |
| 23 |
some detail, including major improvements from the previous release and new |
| 24 |
feature work. All LLVM releases may be downloaded from the `LLVM releases web |
| 25 |
site <https://llvm.org/releases/>`_. |
| 26 |
|
| 27 |
For more information about Clang or LLVM, including information about |
| 28 |
the latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or |
| 29 |
the `LLVM Web Site <https://llvm.org>`_. |
| 30 |
|
| 31 |
Note that if you are reading this file from a Git checkout or the |
| 32 |
main Clang web page, this document applies to the *next* release, not |
| 33 |
the current one. To see the release notes for a specific release, please |
| 34 |
see the `releases page <https://llvm.org/releases/>`_. |
| 35 |
|
| 36 |
What's New in Extra Clang Tools |release|? |
| 37 |
========================================== |
| 38 |
|
| 39 |
Some of the major new features and improvements to Extra Clang Tools are listed |
| 40 |
here. Generic improvements to Extra Clang Tools as a whole or to its underlying |
| 41 |
infrastructure are described first, followed by tool-specific sections. |
| 42 |
|
| 43 |
Major New Features |
| 44 |
------------------ |
| 45 |
|
| 46 |
... |
| 47 |
|
| 48 |
Improvements to clangd |
| 49 |
---------------------- |
| 50 |
|
| 51 |
- Introduced exmperimental support for C++20 Modules. The experimental support can |
| 52 |
be enabled by `-experimental-modules-support` option. It is in an early development |
| 53 |
stage and may not perform efficiently in real-world scenarios. |
| 54 |
|
| 55 |
Inlay hints |
| 56 |
^^^^^^^^^^^ |
| 57 |
|
| 58 |
Diagnostics |
| 59 |
^^^^^^^^^^^ |
| 60 |
|
| 61 |
Semantic Highlighting |
| 62 |
^^^^^^^^^^^^^^^^^^^^^ |
| 63 |
|
| 64 |
- Improved semantic token coverage in some edge cases, e.g. IndirectFieldDecl |
| 65 |
|
| 66 |
Compile flags |
| 67 |
^^^^^^^^^^^^^ |
| 68 |
|
| 69 |
Hover |
| 70 |
^^^^^ |
| 71 |
|
| 72 |
Code completion |
| 73 |
^^^^^^^^^^^^^^^ |
| 74 |
|
| 75 |
- ``--function-arg-placeholders=0`` is now respected for variable template argument lists |
| 76 |
as well |
| 77 |
- Macro proposals now use the completion item kind ``Constant`` (for object-like macros) |
| 78 |
or ``Function`` (for function-style macros) even for proposals coming from the index |
| 79 |
|
| 80 |
Code actions |
| 81 |
^^^^^^^^^^^^ |
| 82 |
|
| 83 |
- The "extract variable" tweak is no longer offered for the initializer expression of a |
| 84 |
declaration |
| 85 |
- The tweak for turning unscoped into scoped enums now removes redundant prefixes |
| 86 |
from the enum values. |
| 87 |
- Support "move function body out-of-line" in non-header files as well |
| 88 |
|
| 89 |
Signature help |
| 90 |
^^^^^^^^^^^^^^ |
| 91 |
|
| 92 |
- Signature help now shows function argument names for calls through pointers to |
| 93 |
functions in struct fields |
| 94 |
|
| 95 |
Cross-references |
| 96 |
^^^^^^^^^^^^^^^^ |
| 97 |
|
| 98 |
- Improve go-to-definition for some concept references |
| 99 |
|
| 100 |
Document outline |
| 101 |
^^^^^^^^^^^^^^^^ |
| 102 |
|
| 103 |
- Improved precision of document outline information for symbols whose definitions |
| 104 |
involve macro expansions |
| 105 |
|
| 106 |
Clang-tidy integration |
| 107 |
^^^^^^^^^^^^^^^^^^^^^^ |
| 108 |
|
| 109 |
- The quick fix for clang-tidy's ``readability-identifier-naming`` diagnostic is now |
| 110 |
hooked to invoke ``textDocument/rename``, renaming the identifier across the whole |
| 111 |
project rather than just the translation unit of the diagnostic |
| 112 |
- ``misc-const-correctness`` can now be enabled with ``FastCheckFilter: None`` |
| 113 |
(previously clangd would force it off unconditionally due to its run time) |
| 114 |
|
| 115 |
Objective-C |
| 116 |
^^^^^^^^^^^ |
| 117 |
|
| 118 |
- Added support for renaming Objective-C methods |
| 119 |
|
| 120 |
Miscellaneous |
| 121 |
^^^^^^^^^^^^^ |
| 122 |
|
| 123 |
- Worked around a clang-format bug that caused memory exhaustion when opening some large |
| 124 |
``.h`` files due to the formatter's language guessing heuristic (#GH85703) |
| 125 |
- Various other stability improvements, e.g. crash fixes |
| 126 |
- Added a boolean option `AnalyzeAngledIncludes` to `Includes` config section, |
| 127 |
which allows to enable unused includes detection for all angled ("system") headers. |
| 128 |
At this moment umbrella headers are not supported, so enabling this option |
| 129 |
may result in false-positives. |
| 130 |
|
| 131 |
Improvements to clang-doc |
| 132 |
------------------------- |
| 133 |
|
| 134 |
Improvements to clang-query |
| 135 |
--------------------------- |
| 136 |
|
| 137 |
- Added the `file` command to dynamically load a list of commands and matchers |
| 138 |
from an external file, allowing the cost of reading the compilation database |
| 139 |
and building the AST to be imposed just once for faster prototyping. |
| 140 |
|
| 141 |
- Removed support for ``enable output srcloc``. Fixes #GH82591 |
| 142 |
|
| 143 |
Improvements to clang-rename |
| 144 |
---------------------------- |
| 145 |
|
| 146 |
The improvements are... |
| 147 |
|
| 148 |
Improvements to clang-tidy |
| 149 |
-------------------------- |
| 150 |
|
| 151 |
- Improved :program:`run-clang-tidy.py` script. Added argument `-source-filter` |
| 152 |
to filter source files from the compilation database, via a RegEx. In a |
| 153 |
similar fashion to what `-header-filter` does for header files. |
| 154 |
Added progress indicator with a number of processed files and the runtime of |
| 155 |
each invocation after completion. |
| 156 |
|
| 157 |
- Improved :program:`check_clang_tidy.py` script. Added argument `-export-fixes` |
| 158 |
to aid in clang-tidy and test development. |
| 159 |
|
| 160 |
- Fixed bug where big values for unsigned check options overflowed into negative values |
| 161 |
when being printed with `--dump-config`. |
| 162 |
|
| 163 |
- Fixed `--verify-config` option not properly parsing checks when using the |
| 164 |
literal operator in the `.clang-tidy` config. |
| 165 |
|
| 166 |
- Added argument `--exclude-header-filter` and config option `ExcludeHeaderFilterRegex` |
| 167 |
to exclude headers from analysis via a RegEx. |
| 168 |
|
| 169 |
- Added argument `--allow-no-checks` to suppress "no checks enabled" error |
| 170 |
when disabling all of the checks by `--checks='-*'`. |
| 171 |
|
| 172 |
New checks |
| 173 |
^^^^^^^^^^ |
| 174 |
|
| 175 |
- New :doc:`boost-use-ranges |
| 176 |
<clang-tidy/checks/boost/use-ranges>` check. |
| 177 |
|
| 178 |
Detects calls to standard library iterator algorithms that could be replaced |
| 179 |
with a Boost ranges version instead. |
| 180 |
|
| 181 |
- New :doc:`bugprone-crtp-constructor-accessibility |
| 182 |
<clang-tidy/checks/bugprone/crtp-constructor-accessibility>` check. |
| 183 |
|
| 184 |
Detects error-prone Curiously Recurring Template Pattern usage, when the CRTP |
| 185 |
can be constructed outside itself and the derived class. |
| 186 |
|
| 187 |
- New :doc:`bugprone-pointer-arithmetic-on-polymorphic-object |
| 188 |
<clang-tidy/checks/bugprone/pointer-arithmetic-on-polymorphic-object>` check. |
| 189 |
|
| 190 |
Finds pointer arithmetic performed on classes that contain a virtual function. |
| 191 |
|
| 192 |
- New :doc:`bugprone-return-const-ref-from-parameter |
| 193 |
<clang-tidy/checks/bugprone/return-const-ref-from-parameter>` check. |
| 194 |
|
| 195 |
Detects return statements that return a constant reference parameter as constant |
| 196 |
reference. This may cause use-after-free errors if the caller uses xvalues as |
| 197 |
arguments. |
| 198 |
|
| 199 |
- New :doc:`bugprone-suspicious-stringview-data-usage |
| 200 |
<clang-tidy/checks/bugprone/suspicious-stringview-data-usage>` check. |
| 201 |
|
| 202 |
Identifies suspicious usages of ``std::string_view::data()`` that could lead |
| 203 |
to reading out-of-bounds data due to inadequate or incorrect string null |
| 204 |
termination. |
| 205 |
|
| 206 |
- New :doc:`misc-use-internal-linkage |
| 207 |
<clang-tidy/checks/misc/use-internal-linkage>` check. |
| 208 |
|
| 209 |
Detects variables and functions that can be marked as static or moved into |
| 210 |
an anonymous namespace to enforce internal linkage. |
| 211 |
|
| 212 |
- New :doc:`modernize-min-max-use-initializer-list |
| 213 |
<clang-tidy/checks/modernize/min-max-use-initializer-list>` check. |
| 214 |
|
| 215 |
Replaces nested ``std::min`` and ``std::max`` calls with an initializer list |
| 216 |
where applicable. |
| 217 |
|
| 218 |
- New :doc:`modernize-use-designated-initializers |
| 219 |
<clang-tidy/checks/modernize/use-designated-initializers>` check. |
| 220 |
|
| 221 |
Finds initializer lists for aggregate types that could be |
| 222 |
written as designated initializers instead. |
| 223 |
|
| 224 |
- New :doc:`modernize-use-ranges |
| 225 |
<clang-tidy/checks/modernize/use-ranges>` check. |
| 226 |
|
| 227 |
Detects calls to standard library iterator algorithms that could be replaced |
| 228 |
with a ranges version instead. |
| 229 |
|
| 230 |
- New :doc:`modernize-use-std-format |
| 231 |
<clang-tidy/checks/modernize/use-std-format>` check. |
| 232 |
|
| 233 |
Converts calls to ``absl::StrFormat``, or other functions via |
| 234 |
configuration options, to C++20's ``std::format``, or another function |
| 235 |
via a configuration option, modifying the format string appropriately and |
| 236 |
removing now-unnecessary calls to ``std::string::c_str()`` and |
| 237 |
``std::string::data()``. |
| 238 |
|
| 239 |
- New :doc:`readability-enum-initial-value |
| 240 |
<clang-tidy/checks/readability/enum-initial-value>` check. |
| 241 |
|
| 242 |
Enforces consistent style for enumerators' initialization, covering three |
| 243 |
styles: none, first only, or all initialized explicitly. |
| 244 |
|
| 245 |
- New :doc:`readability-math-missing-parentheses |
| 246 |
<clang-tidy/checks/readability/math-missing-parentheses>` check. |
| 247 |
|
| 248 |
Check for missing parentheses in mathematical expressions that involve |
| 249 |
operators of different priorities. |
| 250 |
|
| 251 |
- New :doc:`readability-use-std-min-max |
| 252 |
<clang-tidy/checks/readability/use-std-min-max>` check. |
| 253 |
|
| 254 |
Replaces certain conditional statements with equivalent calls to |
| 255 |
``std::min`` or ``std::max``. |
| 256 |
|
| 257 |
New check aliases |
| 258 |
^^^^^^^^^^^^^^^^^ |
| 259 |
|
| 260 |
- New alias :doc:`cert-ctr56-cpp <clang-tidy/checks/cert/ctr56-cpp>` to |
| 261 |
:doc:`bugprone-pointer-arithmetic-on-polymorphic-object |
| 262 |
<clang-tidy/checks/bugprone/pointer-arithmetic-on-polymorphic-object>` |
| 263 |
was added. |
| 264 |
|
| 265 |
- New alias :doc:`cert-int09-c <clang-tidy/checks/cert/int09-c>` to |
| 266 |
:doc:`readability-enum-initial-value <clang-tidy/checks/readability/enum-initial-value>` |
| 267 |
was added. |
| 268 |
|
| 269 |
Changes in existing checks |
| 270 |
^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 271 |
|
| 272 |
- Improved :doc:`bugprone-assert-side-effect |
| 273 |
<clang-tidy/checks/bugprone/assert-side-effect>` check by detecting side |
| 274 |
effect from calling a method with non-const reference parameters. |
| 275 |
|
| 276 |
- Improved :doc:`bugprone-assignment-in-if-condition |
| 277 |
<clang-tidy/checks/bugprone/assignment-in-if-condition>` check by ignoring |
| 278 |
assignments in the C++20 ``requires`` clause. |
| 279 |
|
| 280 |
- Improved :doc:`bugprone-casting-through-void |
| 281 |
<clang-tidy/checks/bugprone/casting-through-void>` check by ignoring casts |
| 282 |
where source is already a ``void``` pointer, making middle ``void`` pointer |
| 283 |
casts bug-free. |
| 284 |
|
| 285 |
- Improved :doc:`bugprone-exception-escape |
| 286 |
<clang-tidy/checks/bugprone/exception-escape>` check to correctly detect exception |
| 287 |
handler of type ``CV void *`` as catching all ``CV`` compatible pointer types. |
| 288 |
|
| 289 |
- Improved :doc:`bugprone-forwarding-reference-overload |
| 290 |
<clang-tidy/checks/bugprone/forwarding-reference-overload>` |
| 291 |
check to ignore deleted constructors which won't hide other overloads. |
| 292 |
|
| 293 |
- Improved :doc:`bugprone-implicit-widening-of-multiplication-result |
| 294 |
<clang-tidy/checks/bugprone/implicit-widening-of-multiplication-result>` check |
| 295 |
by adding an option to ignore constant expressions of signed integer types |
| 296 |
that fit in the source expression type. |
| 297 |
|
| 298 |
- Improved :doc:`bugprone-inc-dec-in-conditions |
| 299 |
<clang-tidy/checks/bugprone/inc-dec-in-conditions>` check to ignore code |
| 300 |
within unevaluated contexts, such as ``decltype``. |
| 301 |
|
| 302 |
- Improved :doc:`bugprone-lambda-function-name<clang-tidy/checks/bugprone/lambda-function-name>` |
| 303 |
check by ignoring ``__func__`` macro in lambda captures, initializers of |
| 304 |
default parameters and nested function declarations. |
| 305 |
|
| 306 |
- Improved :doc:`bugprone-multi-level-implicit-pointer-conversion |
| 307 |
<clang-tidy/checks/bugprone/multi-level-implicit-pointer-conversion>` check |
| 308 |
by ignoring implicit pointer conversions that are part of a cast expression. |
| 309 |
|
| 310 |
- Improved :doc:`bugprone-non-zero-enum-to-bool-conversion |
| 311 |
<clang-tidy/checks/bugprone/non-zero-enum-to-bool-conversion>` check by |
| 312 |
eliminating false positives resulting from direct usage of bitwise operators |
| 313 |
within parentheses. |
| 314 |
|
| 315 |
- Improved :doc:`bugprone-optional-value-conversion |
| 316 |
<clang-tidy/checks/bugprone/optional-value-conversion>` check by eliminating |
| 317 |
false positives resulting from use of optionals in unevaluated context. |
| 318 |
|
| 319 |
- Improved :doc:`bugprone-sizeof-expression |
| 320 |
<clang-tidy/checks/bugprone/sizeof-expression>` check by clarifying the |
| 321 |
diagnostics, eliminating some false positives and adding a new |
| 322 |
(off-by-default) option `WarnOnSizeOfPointer` that reports all |
| 323 |
``sizeof(pointer)`` expressions (except for a few that are idiomatic). |
| 324 |
|
| 325 |
- Improved :doc:`bugprone-suspicious-include |
| 326 |
<clang-tidy/checks/bugprone/suspicious-include>` check by replacing the local |
| 327 |
options `HeaderFileExtensions` and `ImplementationFileExtensions` by the |
| 328 |
global options of the same name. |
| 329 |
|
| 330 |
- Improved :doc:`bugprone-too-small-loop-variable |
| 331 |
<clang-tidy/checks/bugprone/too-small-loop-variable>` check by incorporating |
| 332 |
better support for ``const`` loop boundaries. |
| 333 |
|
| 334 |
- Improved :doc:`bugprone-unused-local-non-trivial-variable |
| 335 |
<clang-tidy/checks/bugprone/unused-local-non-trivial-variable>` check by |
| 336 |
ignoring local variable with ``[maybe_unused]`` attribute. |
| 337 |
|
| 338 |
- Improved :doc:`bugprone-unused-return-value |
| 339 |
<clang-tidy/checks/bugprone/unused-return-value>` check by updating the |
| 340 |
parameter `CheckedFunctions` to support regexp, avoiding false positive for |
| 341 |
function with the same prefix as the default argument, e.g. ``std::unique_ptr`` |
| 342 |
and ``std::unique``, avoiding false positive for assignment operator overloading. |
| 343 |
|
| 344 |
- Improved :doc:`bugprone-use-after-move |
| 345 |
<clang-tidy/checks/bugprone/use-after-move>` check to also handle |
| 346 |
calls to ``std::forward``. Fixed sequencing of designated initializers. Fixed |
| 347 |
sequencing of callees: In C++17 and later, the callee of a function is guaranteed |
| 348 |
to be sequenced before the arguments, so don't warn if the use happens in the |
| 349 |
callee and the move happens in one of the arguments. |
| 350 |
|
| 351 |
- Improved :doc:`cppcoreguidelines-avoid-non-const-global-variables |
| 352 |
<clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables>` check |
| 353 |
with a new option `AllowInternalLinkage` to disable the warning for variables |
| 354 |
with internal linkage. |
| 355 |
|
| 356 |
- Improved :doc:`cppcoreguidelines-macro-usage |
| 357 |
<clang-tidy/checks/cppcoreguidelines/macro-usage>` check by ignoring macro with |
| 358 |
hash preprocessing token. |
| 359 |
|
| 360 |
- Improved :doc:`cppcoreguidelines-missing-std-forward |
| 361 |
<clang-tidy/checks/cppcoreguidelines/missing-std-forward>` check by no longer |
| 362 |
giving false positives for deleted functions, by fixing false negatives when only |
| 363 |
a few parameters are forwarded and by ignoring parameters without a name (unused |
| 364 |
arguments). |
| 365 |
|
| 366 |
- Improved :doc:`cppcoreguidelines-owning-memory |
| 367 |
<clang-tidy/checks/cppcoreguidelines/owning-memory>` check to properly handle |
| 368 |
return type in lambdas and in nested functions. |
| 369 |
|
| 370 |
- Improved :doc:`cppcoreguidelines-prefer-member-initializer |
| 371 |
<clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check |
| 372 |
by removing enforcement of rule `C.48 |
| 373 |
<https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c48-prefer-in-class-initializers-to-member-initializers-in-constructors-for-constant-initializers>`_, |
| 374 |
which was deprecated since :program:`clang-tidy` 17. This rule is now covered |
| 375 |
by :doc:`cppcoreguidelines-use-default-member-init |
| 376 |
<clang-tidy/checks/cppcoreguidelines/use-default-member-init>`. Fixed |
| 377 |
incorrect hints when using list-initialization. |
| 378 |
|
| 379 |
- Improved :doc:`cppcoreguidelines-special-member-functions |
| 380 |
<clang-tidy/checks/cppcoreguidelines/special-member-functions>` check with a |
| 381 |
new option `AllowImplicitlyDeletedCopyOrMove`, which removes the requirement |
| 382 |
for explicit copy or move special member functions when they are already |
| 383 |
implicitly deleted. |
| 384 |
|
| 385 |
- Improved :doc:`google-build-namespaces |
| 386 |
<clang-tidy/checks/google/build-namespaces>` check by replacing the local |
| 387 |
option `HeaderFileExtensions` by the global option of the same name. |
| 388 |
|
| 389 |
- Improved :doc:`google-explicit-constructor |
| 390 |
<clang-tidy/checks/google/explicit-constructor>` check to better handle |
| 391 |
C++20 `explicit(bool)`. |
| 392 |
|
| 393 |
- Improved :doc:`google-global-names-in-headers |
| 394 |
<clang-tidy/checks/google/global-names-in-headers>` check by replacing the local |
| 395 |
option `HeaderFileExtensions` by the global option of the same name. |
| 396 |
|
| 397 |
- Improved :doc:`google-runtime-int <clang-tidy/checks/google/runtime-int>` |
| 398 |
check performance through optimizations. |
| 399 |
|
| 400 |
- Improved :doc:`hicpp-signed-bitwise <clang-tidy/checks/hicpp/signed-bitwise>` |
| 401 |
check by ignoring false positives involving positive integer literals behind |
| 402 |
implicit casts when `IgnorePositiveIntegerLiterals` is enabled. |
| 403 |
|
| 404 |
- Improved :doc:`hicpp-ignored-remove-result <clang-tidy/checks/hicpp/ignored-remove-result>` |
| 405 |
check by ignoring other functions with same prefixes as the target specific |
| 406 |
functions. |
| 407 |
|
| 408 |
- Improved :doc:`linuxkernel-must-check-errs |
| 409 |
<clang-tidy/checks/linuxkernel/must-check-errs>` check documentation to |
| 410 |
consistently use the check's proper name. |
| 411 |
|
| 412 |
- Improved :doc:`llvm-header-guard |
| 413 |
<clang-tidy/checks/llvm/header-guard>` check by replacing the local |
| 414 |
option `HeaderFileExtensions` by the global option of the same name. |
| 415 |
|
| 416 |
- Improved :doc:`misc-const-correctness |
| 417 |
<clang-tidy/checks/misc/const-correctness>` check by avoiding infinite recursion |
| 418 |
for recursive functions with forwarding reference parameters and reference |
| 419 |
variables which refer to themselves. Also adapted the check to work with |
| 420 |
function-try-blocks. |
| 421 |
|
| 422 |
- Improved :doc:`misc-definitions-in-headers |
| 423 |
<clang-tidy/checks/misc/definitions-in-headers>` check by replacing the local |
| 424 |
option `HeaderFileExtensions` by the global option of the same name. |
| 425 |
Additionally, the option `UseHeaderFileExtensions` is removed, so that the |
| 426 |
check uses the `HeaderFileExtensions` option unconditionally. |
| 427 |
|
| 428 |
- Improved :doc:`misc-header-include-cycle |
| 429 |
<clang-tidy/checks/misc/header-include-cycle>` check by avoiding crash for self |
| 430 |
include cycles. |
| 431 |
|
| 432 |
- Improved :doc:`misc-unused-using-decls |
| 433 |
<clang-tidy/checks/misc/unused-using-decls>` check by replacing the local |
| 434 |
option `HeaderFileExtensions` by the global option of the same name. |
| 435 |
|
| 436 |
- Improved :doc:`misc-use-anonymous-namespace |
| 437 |
<clang-tidy/checks/misc/use-anonymous-namespace>` check by replacing the local |
| 438 |
option `HeaderFileExtensions` by the global option of the same name. |
| 439 |
|
| 440 |
- Improved :doc:`modernize-avoid-c-arrays |
| 441 |
<clang-tidy/checks/modernize/avoid-c-arrays>` check by introducing the new |
| 442 |
`AllowStringArrays` option, enabling the exclusion of array types with deduced |
| 443 |
length initialized from string literals. |
| 444 |
|
| 445 |
- Improved :doc:`modernize-loop-convert |
| 446 |
<clang-tidy/checks/modernize/loop-convert>` check by ensuring that fix-its |
| 447 |
don't remove parentheses used in ``sizeof`` calls when they have array index |
| 448 |
accesses as arguments. |
| 449 |
|
| 450 |
- Improved :doc:`modernize-use-constraints |
| 451 |
<clang-tidy/checks/modernize/use-constraints>` check by fixing a crash that |
| 452 |
occurred in some scenarios and excluding system headers from analysis. |
| 453 |
|
| 454 |
- Improved :doc:`modernize-use-nullptr |
| 455 |
<clang-tidy/checks/modernize/use-nullptr>` check to include support for C23, |
| 456 |
which also has introduced the ``nullptr`` keyword. |
| 457 |
|
| 458 |
- Improved :doc:`modernize-use-override |
| 459 |
<clang-tidy/checks/modernize/use-override>` check to also remove any trailing |
| 460 |
whitespace when deleting the ``virtual`` keyword. |
| 461 |
|
| 462 |
- Improved :doc:`modernize-use-starts-ends-with |
| 463 |
<clang-tidy/checks/modernize/use-starts-ends-with>` check to also handle |
| 464 |
calls to ``compare`` method. |
| 465 |
|
| 466 |
- Improved :doc:`modernize-use-std-print |
| 467 |
<clang-tidy/checks/modernize/use-std-print>` check to not crash if the |
| 468 |
format string parameter of the function to be replaced is not of the |
| 469 |
expected type. |
| 470 |
|
| 471 |
- Improved :doc:`modernize-use-using <clang-tidy/checks/modernize/use-using>` |
| 472 |
check by adding support for detection of typedefs declared on function level. |
| 473 |
|
| 474 |
- Improved :doc:`performance-inefficient-vector-operation |
| 475 |
<clang-tidy/checks/performance/inefficient-vector-operation>` fixing false |
| 476 |
negatives caused by different variable definition type and variable initial |
| 477 |
value type in loop initialization expression. |
| 478 |
|
| 479 |
- Improved :doc:`performance-move-const-arg |
| 480 |
<clang-tidy/checks/performance/move-const-arg>` check by ignoring |
| 481 |
``std::move()`` calls when their target is used as an rvalue. |
| 482 |
|
| 483 |
- Improved :doc:`performance-unnecessary-copy-initialization |
| 484 |
<clang-tidy/checks/performance/unnecessary-copy-initialization>` check by |
| 485 |
detecting more cases of constant access. In particular, pointers can be |
| 486 |
analyzed, so the check now handles the common patterns |
| 487 |
`const auto e = (*vector_ptr)[i]` and `const auto e = vector_ptr->at(i);`. |
| 488 |
Calls to mutable function where there exists a `const` overload are also |
| 489 |
handled. Fix crash in the case of a non-member operator call. |
| 490 |
|
| 491 |
- Improved :doc:`performance-unnecessary-value-param |
| 492 |
<clang-tidy/checks/performance/unnecessary-value-param>` check |
| 493 |
detecting more cases for template functions including lambdas with ``auto``. |
| 494 |
E.g., ``std::sort(a.begin(), a.end(), [](auto x, auto y) { return a > b; });`` |
| 495 |
will be detected for expensive to copy types. Fixed false positives for |
| 496 |
dependent call expressions. |
| 497 |
|
| 498 |
- Improved :doc:`readability-avoid-return-with-void-value |
| 499 |
<clang-tidy/checks/readability/avoid-return-with-void-value>` check by adding |
| 500 |
fix-its. |
| 501 |
|
| 502 |
- Improved :doc:`readability-const-return-type |
| 503 |
<clang-tidy/checks/readability/const-return-type>` check to eliminate false |
| 504 |
positives when returning types with const not at the top level. |
| 505 |
|
| 506 |
- Improved :doc:`readability-container-size-empty |
| 507 |
<clang-tidy/checks/readability/container-size-empty>` check to prevent false |
| 508 |
positives when utilizing ``size`` or ``length`` methods that accept parameter. |
| 509 |
Fixed crash when facing template user defined literals. |
| 510 |
|
| 511 |
- Improved :doc:`readability-duplicate-include |
| 512 |
<clang-tidy/checks/readability/duplicate-include>` check by excluding include |
| 513 |
directives that form the filename using macro. |
| 514 |
|
| 515 |
- Improved :doc:`readability-else-after-return |
| 516 |
<clang-tidy/checks/readability/else-after-return>` check to ignore |
| 517 |
`if consteval` statements, for which the `else` branch must not be removed. |
| 518 |
|
| 519 |
- Improved :doc:`readability-identifier-naming |
| 520 |
<clang-tidy/checks/readability/identifier-naming>` check in `GetConfigPerFile` |
| 521 |
mode by resolving symbolic links to header files. Fixed handling of Hungarian |
| 522 |
Prefix when configured to `LowerCase`. Added support for renaming designated |
| 523 |
initializers. Added support for renaming macro arguments. Fixed renaming |
| 524 |
conflicts arising from out-of-line member function template definitions. |
| 525 |
|
| 526 |
- Improved :doc:`readability-implicit-bool-conversion |
| 527 |
<clang-tidy/checks/readability/implicit-bool-conversion>` check to provide |
| 528 |
valid fix suggestions for ``static_cast`` without a preceding space and |
| 529 |
fixed problem with duplicate parentheses in double implicit casts. Corrected |
| 530 |
the fix suggestions for C23 and later by using C-style casts instead of |
| 531 |
``static_cast``. Fixed false positives in C++20 spaceship operator by ignoring |
| 532 |
casts in implicit and defaulted functions. |
| 533 |
|
| 534 |
- Improved :doc:`readability-non-const-parameter |
| 535 |
<clang-tidy/checks/readability/non-const-parameter>` check to not crash when |
| 536 |
redeclaration have fewer parameters than expected. |
| 537 |
|
| 538 |
- Improved :doc:`readability-redundant-inline-specifier |
| 539 |
<clang-tidy/checks/readability/redundant-inline-specifier>` check to properly |
| 540 |
emit warnings for static data member with an in-class initializer. |
| 541 |
|
| 542 |
- Improved :doc:`readability-redundant-member-init |
| 543 |
<clang-tidy/checks/readability/redundant-member-init>` check to avoid |
| 544 |
false-positives when type of the member does not match the type of the |
| 545 |
initializer. |
| 546 |
|
| 547 |
- Improved :doc:`readability-static-accessed-through-instance |
| 548 |
<clang-tidy/checks/readability/static-accessed-through-instance>` check to |
| 549 |
support calls to overloaded operators as base expression and provide fixes to |
| 550 |
expressions with side-effects. |
| 551 |
|
| 552 |
- Improved :doc:`readability-simplify-boolean-expr |
| 553 |
<clang-tidy/checks/readability/simplify-boolean-expr>` check to avoid to emit |
| 554 |
warning for macro when IgnoreMacro option is enabled and improve messages |
| 555 |
when auto-fix does not work. |
| 556 |
|
| 557 |
- Improved :doc:`readability-static-definition-in-anonymous-namespace |
| 558 |
<clang-tidy/checks/readability/static-definition-in-anonymous-namespace>` |
| 559 |
check by resolving fix-it overlaps in template code by disregarding implicit |
| 560 |
instances. |
| 561 |
|
| 562 |
- Improved :doc:`readability-string-compare |
| 563 |
<clang-tidy/checks/readability/string-compare>` check to also detect |
| 564 |
usages of ``std::string_view::compare``. Added a `StringLikeClasses` option |
| 565 |
to detect usages of ``compare`` method in custom string-like classes. |
| 566 |
|
| 567 |
Removed checks |
| 568 |
^^^^^^^^^^^^^^ |
| 569 |
|
| 570 |
- Removed `cert-dcl21-cpp`, which was deprecated since :program:`clang-tidy` 17, |
| 571 |
since the rule DCL21-CPP has been removed from the CERT guidelines. |
| 572 |
|
| 573 |
Miscellaneous |
| 574 |
^^^^^^^^^^^^^ |
| 575 |
|
| 576 |
- Fixed incorrect formatting in :program:`clang-apply-replacements` when no |
| 577 |
`--format` option is specified. Now :program:`clang-apply-replacements` |
| 578 |
applies formatting only with the option. |
| 579 |
|
| 580 |
Improvements to include-fixer |
| 581 |
----------------------------- |
| 582 |
|
| 583 |
The improvements are... |
| 584 |
|
| 585 |
Improvements to clang-include-fixer |
| 586 |
----------------------------------- |
| 587 |
|
| 588 |
The improvements are... |
| 589 |
|
| 590 |
Improvements to modularize |
| 591 |
-------------------------- |
| 592 |
|
| 593 |
The improvements are... |
| 594 |
|
| 595 |
Improvements to pp-trace |
| 596 |
------------------------ |
| 597 |
|
| 598 |
Clang-tidy Visual Studio plugin |
| 599 |
------------------------------- |