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.
76 - Added completion for C++20 keywords.
81 - Added `Swap operands` tweak for certain binary operators.
83 - Improved the extract-to-function code action to allow extracting statements
84 with overloaded operators like ``<<`` of ``std::ostream``.
98 - The DefineOutline tweak now handles member functions of class templates.
100 Improvements to clang-doc
101 -------------------------
103 Improvements to clang-query
104 ---------------------------
106 - Added `set enable-profile true/false` command for basic matcher profiling.
108 Improvements to clang-tidy
109 --------------------------
111 - Improved :program:`clang-tidy`'s `--verify-config` flag by adding support for
112 the configuration options of the `Clang Static Analyzer Checks
113 <https://clang.llvm.org/docs/analyzer/checkers.html>`_.
115 - Improved :program:`run-clang-tidy.py` script. Fixed minor shutdown noise
116 happening on certain platforms when interrupting the script.
121 - New :doc:`bugprone-bitwise-pointer-cast
122 <clang-tidy/checks/bugprone/bitwise-pointer-cast>` check.
124 Warns about code that tries to cast between pointers by means of
125 ``std::bit_cast`` or ``memcpy``.
127 - New :doc:`bugprone-nondeterministic-pointer-iteration-order
128 <clang-tidy/checks/bugprone/nondeterministic-pointer-iteration-order>`
131 Finds nondeterministic usages of pointers in unordered containers.
133 - New :doc:`bugprone-tagged-union-member-count
134 <clang-tidy/checks/bugprone/tagged-union-member-count>` check.
136 Gives warnings for tagged unions, where the number of tags is
137 different from the number of data members inside the union.
139 - New :doc:`portability-template-virtual-member-function
140 <clang-tidy/checks/portability/template-virtual-member-function>` check.
142 Finds cases when an uninstantiated virtual member function in a template class
143 causes cross-compiler incompatibility.
148 - New alias :doc:`cert-arr39-c <clang-tidy/checks/cert/arr39-c>` to
149 :doc:`bugprone-sizeof-expression
150 <clang-tidy/checks/bugprone/sizeof-expression>` was added.
152 Changes in existing checks
153 ^^^^^^^^^^^^^^^^^^^^^^^^^^
155 - Improved :doc:`altera-id-dependent-backward-branch
156 <clang-tidy/checks/altera/id-dependent-backward-branch>` check by fixing
157 crashes from invalid code.
159 - Improved :doc:`bugprone-casting-through-void
160 <clang-tidy/checks/bugprone/casting-through-void>` check to suggest replacing
161 the offending code with ``reinterpret_cast``, to more clearly express intent.
163 - Improved :doc:`bugprone-dangling-handle
164 <clang-tidy/checks/bugprone/dangling-handle>` check to treat `std::span` as a
167 - Improved :doc:`bugprone-exception-escape
168 <clang-tidy/checks/bugprone/exception-escape>` by fixing false positives
169 when a consteval function with throw statements.
171 - Improved :doc:`bugprone-forwarding-reference-overload
172 <clang-tidy/checks/bugprone/forwarding-reference-overload>` check by fixing
173 a crash when determining if an ``enable_if[_t]`` was found.
175 - Improved :doc:`bugprone-posix-return
176 <clang-tidy/checks/bugprone/posix-return>` check to support integer literals
177 as LHS and posix call as RHS of comparison.
179 - Improved :doc:`bugprone-return-const-ref-from-parameter
180 <clang-tidy/checks/bugprone/return-const-ref-from-parameter>` check to
181 diagnose potential dangling references when returning a ``const &`` parameter
182 by using the conditional operator ``cond ? var1 : var2``.
184 - Improved :doc:`bugprone-sizeof-expression
185 <clang-tidy/checks/bugprone/sizeof-expression>` check to find suspicious
186 usages of ``sizeof()``, ``alignof()``, and ``offsetof()`` when adding or
187 subtracting from a pointer directly or when used to scale a numeric value and
188 fix false positive when sizeof expression with template types.
190 - Improved :doc:`bugprone-throw-keyword-missing
191 <clang-tidy/checks/bugprone/throw-keyword-missing>` by fixing a false positive
192 when using non-static member initializers and a constructor.
194 - Improved :doc:`bugprone-unchecked-optional-access
195 <clang-tidy/checks/bugprone/unchecked-optional-access>` to support
196 `bsl::optional` and `bdlb::NullableValue` from
197 <https://github.com/bloomberg/bde>_.
199 - Improved :doc:`bugprone-unsafe-functions
200 <clang-tidy/checks/bugprone/unsafe-functions>` check to allow specifying
201 additional functions to match.
203 - Improved :doc:`bugprone-use-after-move
204 <clang-tidy/checks/bugprone/use-after-move>` to avoid triggering on
205 ``reset()`` calls on moved-from ``std::optional`` and ``std::any`` objects,
206 similarly to smart pointers.
208 - Improved :doc:`cert-flp30-c <clang-tidy/checks/cert/flp30-c>` check to
209 fix false positive that floating point variable is only used in increment
212 - Improved :doc:`cppcoreguidelines-avoid-const-or-ref-data-members
213 <clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members>` check to
214 avoid false positives when detecting a templated class with inheritance.
216 - Improved :doc:`cppcoreguidelines-init-variables
217 <clang-tidy/checks/cppcoreguidelines/init-variables>` check by fixing the
218 insertion location for function pointers.
220 - Improved :doc:`cppcoreguidelines-prefer-member-initializer
221 <clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check to
222 avoid false positive when member initialization depends on a structured
225 - Fixed :doc:`cppcoreguidelines-pro-type-union-access
226 <clang-tidy/checks/cppcoreguidelines/pro-type-union-access>` check to
227 report a location even when the member location is not valid.
229 - Improved :doc:`misc-definitions-in-headers
230 <clang-tidy/checks/misc/definitions-in-headers>` check by rewording the
231 diagnostic note that suggests adding ``inline``.
233 - Improved :doc:`misc-unconventional-assign-operator
234 <clang-tidy/checks/misc/unconventional-assign-operator>` check to avoid
235 false positive for C++23 deducing this.
237 - Improved :doc:`misc-use-internal-linkage
238 <clang-tidy/checks/misc/use-internal-linkage>` check to insert ``static``
239 keyword before type qualifiers such as ``const`` and ``volatile`` and fix
240 false positives for function declaration without body.
242 - Improved :doc:`modernize-avoid-c-arrays
243 <clang-tidy/checks/modernize/avoid-c-arrays>` check to suggest using
244 ``std::span`` as a replacement for parameters of incomplete C array type in
245 C++20 and ``std::array`` or ``std::vector`` before C++20.
247 - Improved :doc:`modernize-loop-convert
248 <clang-tidy/checks/modernize/loop-convert>` check to fix false positive when
249 using loop variable in initializer of lambda capture.
251 - Improved :doc:`modernize-min-max-use-initializer-list
252 <clang-tidy/checks/modernize/min-max-use-initializer-list>` check by fixing
253 a false positive when only an implicit conversion happened inside an
256 - Improved :doc:`modernize-use-designated-initializers
257 <clang-tidy/checks/modernize/use-designated-initializers>` check to fix a
258 crash when a class is declared but not defined.
260 - Improved :doc:`modernize-use-nullptr
261 <clang-tidy/checks/modernize/use-nullptr>` check to also recognize
262 ``NULL``/``__null`` (but not ``0``) when used with a templated type.
264 - Improved :doc:`modernize-use-starts-ends-with
265 <clang-tidy/checks/modernize/use-starts-ends-with>` check to handle two new
266 cases from ``rfind`` and ``compare`` to ``ends_with``, and one new case from
267 ``substr`` to ``starts_with``, and a small adjustment to the diagnostic message.
269 - Improved :doc:`modernize-use-std-format
270 <clang-tidy/checks/modernize/use-std-format>` check to support replacing
271 member function calls too and to only expand macros starting with ``PRI``
272 and ``__PRI`` from ``<inttypes.h>`` in the format string.
274 - Improved :doc:`modernize-use-std-print
275 <clang-tidy/checks/modernize/use-std-print>` check to support replacing
276 member function calls too and to only expand macros starting with ``PRI``
277 and ``__PRI`` from ``<inttypes.h>`` in the format string.
279 - Improved :doc:`performance-avoid-endl
280 <clang-tidy/checks/performance/avoid-endl>` check to use ``std::endl`` as
281 placeholder when lexer cannot get source text.
283 - Improved :doc:`performance-move-const-arg
284 <clang-tidy/checks/performance/move-const-arg>` check to fix a crash when
285 an argument type is declared but not defined.
287 - Improved :doc:`readability-container-contains
288 <clang-tidy/checks/readability/container-contains>` check to let it work on
289 any class that has a ``contains`` method. Fix some false negatives in the
292 - Improved :doc:`readability-enum-initial-value
293 <clang-tidy/checks/readability/enum-initial-value>` check by only issuing
294 diagnostics for the definition of an ``enum``, by not emitting a redundant
295 file path for anonymous enums in the diagnostic, and by fixing a typo in the
298 - Improved :doc:`readability-implicit-bool-conversion
299 <clang-tidy/checks/readability/implicit-bool-conversion>` check
300 by adding the option `UseUpperCaseLiteralSuffix` to select the
301 case of the literal suffix in fixes and fixing false positive for implicit
302 conversion of comparison result in C23.
304 - Improved :doc:`readability-redundant-smartptr-get
305 <clang-tidy/checks/readability/redundant-smartptr-get>` check to
306 remove `->`, when redundant `get()` is removed.
308 - Improved :doc:`readability-identifier-naming
309 <clang-tidy/checks/readability/identifier-naming>` check to
310 validate ``namespace`` aliases.
318 Improvements to include-fixer
319 -----------------------------
321 The improvements are...
323 Improvements to clang-include-fixer
324 -----------------------------------
326 The improvements are...
328 Improvements to modularize
329 --------------------------
331 The improvements are...
333 Improvements to pp-trace
334 ------------------------
336 Clang-tidy Visual Studio plugin
337 -------------------------------