1 ====================================================
2 Extra Clang Tools |release| |ReleaseNotesTitle|
3 ====================================================
9 Written by the `LLVM Team <https://llvm.org/>`_
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>`_.
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/>`_.
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>`_.
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/>`_.
36 What's New in Extra Clang Tools |release|?
37 ==========================================
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.
46 - The ``clang-pseudo`` tool is incomplete and does not have active maintainers,
47 so it has been removed. See
48 `the RFC <https://discourse.llvm.org/t/removing-pseudo-parser/71131/>`_ for
53 Improvements to clangd
54 ----------------------
59 - Added `DefaultArguments` Inlay Hints option.
79 - Added `Swap operands` tweak for certain binary operators.
81 - Improved the extract-to-function code action to allow extracting statements
82 with overloaded operators like ``<<`` of ``std::ostream``.
96 - The DefineOutline tweak now handles member functions of class templates.
98 Improvements to clang-doc
99 -------------------------
101 Improvements to clang-query
102 ---------------------------
104 - Added `set enable-profile true/false` command for basic matcher profiling.
106 Improvements to clang-tidy
107 --------------------------
109 - Improved :program:`clang-tidy`'s `--verify-config` flag by adding support for
110 the configuration options of the `Clang Static Analyzer Checks
111 <https://clang.llvm.org/docs/analyzer/checkers.html>`_.
113 - Improved :program:`run-clang-tidy.py` script. Fixed minor shutdown noise
114 happening on certain platforms when interrupting the script.
119 - New :doc:`bugprone-bitwise-pointer-cast
120 <clang-tidy/checks/bugprone/bitwise-pointer-cast>` check.
122 Warns about code that tries to cast between pointers by means of
123 ``std::bit_cast`` or ``memcpy``.
125 - New :doc:`bugprone-nondeterministic-pointer-iteration-order
126 <clang-tidy/checks/bugprone/nondeterministic-pointer-iteration-order>`
129 Finds nondeterministic usages of pointers in unordered containers.
131 - New :doc:`bugprone-tagged-union-member-count
132 <clang-tidy/checks/bugprone/tagged-union-member-count>` check.
134 Gives warnings for tagged unions, where the number of tags is
135 different from the number of data members inside the union.
137 - New :doc:`portability-template-virtual-member-function
138 <clang-tidy/checks/portability/template-virtual-member-function>` check.
140 Finds cases when an uninstantiated virtual member function in a template class
141 causes cross-compiler incompatibility.
146 - New alias :doc:`cert-arr39-c <clang-tidy/checks/cert/arr39-c>` to
147 :doc:`bugprone-sizeof-expression
148 <clang-tidy/checks/bugprone/sizeof-expression>` was added.
150 Changes in existing checks
151 ^^^^^^^^^^^^^^^^^^^^^^^^^^
153 - Improved :doc:`altera-id-dependent-backward-branch
154 <clang-tidy/checks/altera/id-dependent-backward-branch>` check by fixing
155 crashes from invalid code.
157 - Improved :doc:`bugprone-casting-through-void
158 <clang-tidy/checks/bugprone/casting-through-void>` check to suggest replacing
159 the offending code with ``reinterpret_cast``, to more clearly express intent.
161 - Improved :doc:`bugprone-dangling-handle
162 <clang-tidy/checks/bugprone/dangling-handle>` check to treat `std::span` as a
165 - Improved :doc:`bugprone-forwarding-reference-overload
166 <clang-tidy/checks/bugprone/forwarding-reference-overload>` check by fixing
167 a crash when determining if an ``enable_if[_t]`` was found.
169 - Improved :doc:`bugprone-posix-return
170 <clang-tidy/checks/bugprone/posix-return>` check to support integer literals
171 as LHS and posix call as RHS of comparison.
173 - Improved :doc:`bugprone-return-const-ref-from-parameter
174 <clang-tidy/checks/bugprone/return-const-ref-from-parameter>` check to
175 diagnose potential dangling references when returning a ``const &`` parameter
176 by using the conditional operator ``cond ? var1 : var2``.
178 - Improved :doc:`bugprone-sizeof-expression
179 <clang-tidy/checks/bugprone/sizeof-expression>` check to find suspicious
180 usages of ``sizeof()``, ``alignof()``, and ``offsetof()`` when adding or
181 subtracting from a pointer directly or when used to scale a numeric value and
182 fix false positive when sizeof expression with template types.
184 - Improved :doc:`bugprone-throw-keyword-missing
185 <clang-tidy/checks/bugprone/throw-keyword-missing>` by fixing a false positive
186 when using non-static member initializers and a constructor.
188 - Improved :doc:`bugprone-unchecked-optional-access
189 <clang-tidy/checks/bugprone/unchecked-optional-access>` to support
190 `bsl::optional` and `bdlb::NullableValue` from
191 <https://github.com/bloomberg/bde>_.
193 - Improved :doc:`bugprone-unsafe-functions
194 <clang-tidy/checks/bugprone/unsafe-functions>` check to allow specifying
195 additional functions to match.
197 - Improved :doc:`bugprone-use-after-move
198 <clang-tidy/checks/bugprone/use-after-move>` to avoid triggering on
199 ``reset()`` calls on moved-from ``std::optional`` and ``std::any`` objects,
200 similarly to smart pointers.
202 - Improved :doc:`cert-flp30-c <clang-tidy/checks/cert/flp30-c>` check to
203 fix false positive that floating point variable is only used in increment
206 - Improved :doc:`cppcoreguidelines-init-variables
207 <clang-tidy/checks/cppcoreguidelines/init-variables>` check by fixing the
208 insertion location for function pointers.
210 - Improved :doc:`cppcoreguidelines-prefer-member-initializer
211 <clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check to
212 avoid false positive when member initialization depends on a structured
215 - Fixed :doc:`cppcoreguidelines-pro-type-union-access
216 <clang-tidy/checks/cppcoreguidelines/pro-type-union-access>` check to
217 report a location even when the member location is not valid.
219 - Improved :doc:`misc-definitions-in-headers
220 <clang-tidy/checks/misc/definitions-in-headers>` check by rewording the
221 diagnostic note that suggests adding ``inline``.
223 - Improved :doc:`misc-unconventional-assign-operator
224 <clang-tidy/checks/misc/unconventional-assign-operator>` check to avoid
225 false positive for C++23 deducing this.
227 - Improved :doc:`modernize-avoid-c-arrays
228 <clang-tidy/checks/modernize/avoid-c-arrays>` check to suggest using
229 ``std::span`` as a replacement for parameters of incomplete C array type in
230 C++20 and ``std::array`` or ``std::vector`` before C++20.
232 - Improved :doc:`modernize-loop-convert
233 <clang-tidy/checks/modernize/loop-convert>` check to fix false positive when
234 using loop variable in initializer of lambda capture.
236 - Improved :doc:`misc-use-internal-linkage
237 <clang-tidy/checks/misc/use-internal-linkage>` check to insert ``static`` keyword
238 before type qualifiers such as ``const`` and ``volatile``.
240 - Improved :doc:`modernize-min-max-use-initializer-list
241 <clang-tidy/checks/modernize/min-max-use-initializer-list>` check by fixing
242 a false positive when only an implicit conversion happened inside an
245 - Improved :doc:`modernize-use-designated-initializers
246 <clang-tidy/checks/modernize/use-designated-initializers>` check to fix a
247 crash when a class is declared but not defined.
249 - Improved :doc:`modernize-use-nullptr
250 <clang-tidy/checks/modernize/use-nullptr>` check to also recognize
251 ``NULL``/``__null`` (but not ``0``) when used with a templated type.
253 - Improved :doc:`modernize-use-starts-ends-with
254 <clang-tidy/checks/modernize/use-starts-ends-with>` check to handle two cases
255 that can be replaced with ``ends_with``
257 - Improved :doc:`modernize-use-std-format
258 <clang-tidy/checks/modernize/use-std-format>` check to support replacing
259 member function calls too and to only expand macros starting with ``PRI``
260 and ``__PRI`` from ``<inttypes.h>`` in the format string.
262 - Improved :doc:`modernize-use-std-print
263 <clang-tidy/checks/modernize/use-std-print>` check to support replacing
264 member function calls too and to only expand macros starting with ``PRI``
265 and ``__PRI`` from ``<inttypes.h>`` in the format string.
267 - Improved :doc:`performance-avoid-endl
268 <clang-tidy/checks/performance/avoid-endl>` check to use ``std::endl`` as
269 placeholder when lexer cannot get source text.
271 - Improved :doc:`performance-move-const-arg
272 <clang-tidy/checks/performance/move-const-arg>` check to fix a crash when
273 an argument type is declared but not defined.
275 - Improved :doc:`readability-container-contains
276 <clang-tidy/checks/readability/container-contains>` check to let it work on
277 any class that has a ``contains`` method. Fix some false negatives in the
280 - Improved :doc:`readability-enum-initial-value
281 <clang-tidy/checks/readability/enum-initial-value>` check by only issuing
282 diagnostics for the definition of an ``enum``, by not emitting a redundant
283 file path for anonymous enums in the diagnostic, and by fixing a typo in the
286 - Improved :doc:`readability-implicit-bool-conversion
287 <clang-tidy/checks/readability/implicit-bool-conversion>` check
288 by adding the option `UseUpperCaseLiteralSuffix` to select the
289 case of the literal suffix in fixes and fixing false positive for implicit
290 conversion of comparison result in C23.
292 - Improved :doc:`readability-redundant-smartptr-get
293 <clang-tidy/checks/readability/redundant-smartptr-get>` check to
294 remove `->`, when redundant `get()` is removed.
296 - Improved :doc:`readability-identifier-naming
297 <clang-tidy/checks/readability/identifier-naming>` check to
298 validate ``namespace`` aliases.
306 Improvements to include-fixer
307 -----------------------------
309 The improvements are...
311 Improvements to clang-include-fixer
312 -----------------------------------
314 The improvements are...
316 Improvements to modularize
317 --------------------------
319 The improvements are...
321 Improvements to pp-trace
322 ------------------------
324 Clang-tidy Visual Studio plugin
325 -------------------------------