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.
48 Improvements to clangd
49 ----------------------
72 - The extract variable tweak gained support for extracting lambda expressions to a variable.
86 Improvements to clang-doc
87 -------------------------
89 Improvements to clang-query
90 ---------------------------
92 The improvements are...
94 Improvements to clang-rename
95 ----------------------------
97 The improvements are...
99 Improvements to clang-tidy
100 --------------------------
102 - Preprocessor-level module header parsing is now disabled by default due to
103 the problems it caused in C++20 and above, leading to performance and code
104 parsing issues regardless of whether modules were used or not. This change
105 will impact only the following checks:
106 :doc:`modernize-replace-disallow-copy-and-assign-macro
107 <clang-tidy/checks/modernize/replace-disallow-copy-and-assign-macro>`,
108 :doc:`bugprone-reserved-identifier
109 <clang-tidy/checks/bugprone/reserved-identifier>`, and
110 :doc:`readability-identifier-naming
111 <clang-tidy/checks/readability/identifier-naming>`. Those checks will no
112 longer see macros defined in modules. Users can still enable this
113 functionality using the newly added command line option
114 `--enable-module-headers-parsing`.
116 - Remove configuration option `AnalyzeTemporaryDestructors`, which was deprecated since
117 :program:`clang-tidy` 16.
119 - Improved `--dump-config` to print check options in alphabetical order.
121 - Improved :program:`clang-tidy-diff.py` script. It now returns exit code `1`
122 if any :program:`clang-tidy` subprocess exits with a non-zero code or if
123 exporting fixes fails.
128 - New :doc:`bugprone-compare-pointer-to-member-virtual-function
129 <clang-tidy/checks/bugprone/compare-pointer-to-member-virtual-function>` check.
131 Detects equality comparison between pointer to member virtual function and
132 anything other than null-pointer-constant.
134 - New :doc:`bugprone-inc-dec-in-conditions
135 <clang-tidy/checks/bugprone/inc-dec-in-conditions>` check.
137 Detects when a variable is both incremented/decremented and referenced inside
138 a complex condition and suggests moving them outside to avoid ambiguity in
139 the variable's value.
141 - New :doc:`bugprone-incorrect-enable-if
142 <clang-tidy/checks/bugprone/incorrect-enable-if>` check.
144 Detects incorrect usages of ``std::enable_if`` that don't name the nested
147 - New :doc:`bugprone-multi-level-implicit-pointer-conversion
148 <clang-tidy/checks/bugprone/multi-level-implicit-pointer-conversion>` check.
150 Detects implicit conversions between pointers of different levels of
153 - New :doc:`bugprone-optional-value-conversion
154 <clang-tidy/checks/bugprone/optional-value-conversion>` check.
156 Detects potentially unintentional and redundant conversions where a value is
157 extracted from an optional-like type and then used to create a new instance
158 of the same optional-like type.
160 - New :doc:`cppcoreguidelines-no-suspend-with-lock
161 <clang-tidy/checks/cppcoreguidelines/no-suspend-with-lock>` check.
163 Flags coroutines that suspend while a lock guard is in scope at the
166 - New :doc:`modernize-use-constraints
167 <clang-tidy/checks/modernize/use-constraints>` check.
169 Replace ``enable_if`` with C++20 requires clauses.
171 - New :doc:`performance-enum-size
172 <clang-tidy/checks/performance/enum-size>` check.
174 Recommends the smallest possible underlying type for an ``enum`` or ``enum``
175 class based on the range of its enumerators.
177 - New :doc:`readability-reference-to-constructed-temporary
178 <clang-tidy/checks/readability/reference-to-constructed-temporary>` check.
180 Detects C++ code where a reference variable is used to extend the lifetime
181 of a temporary object that has just been constructed.
186 - New alias :doc:`cppcoreguidelines-macro-to-enum
187 <clang-tidy/checks/cppcoreguidelines/macro-to-enum>` to :doc:`modernize-macro-to-enum
188 <clang-tidy/checks/modernize/macro-to-enum>` was added.
190 Changes in existing checks
191 ^^^^^^^^^^^^^^^^^^^^^^^^^^
193 - Improved :doc:`bugprone-lambda-function-name
194 <clang-tidy/checks/bugprone/lambda-function-name>` check by adding option
195 `IgnoreMacros` to ignore warnings in macros.
197 - Improved :doc:`bugprone-non-zero-enum-to-bool-conversion
198 <clang-tidy/checks/bugprone/non-zero-enum-to-bool-conversion>` check by
199 eliminating false positives resulting from direct usage of bitwise operators.
201 - Improved :doc:`bugprone-reserved-identifier
202 <clang-tidy/checks/bugprone/reserved-identifier>` check, so that it does not
203 warn on macros starting with underscore and lowercase letter.
205 - Improved :doc:`bugprone-undefined-memory-manipulation
206 <clang-tidy/checks/bugprone/undefined-memory-manipulation>` check to support
207 fixed-size arrays of non-trivial types.
209 - Improved :doc:`cppcoreguidelines-avoid-non-const-global-variables
210 <clang-tidy/checks/cppcoreguidelines/avoid-non-const-global-variables>` check
211 to ignore ``static`` variables declared within the scope of
212 ``class``/``struct``.
214 - Improved :doc:`cppcoreguidelines-avoid-reference-coroutine-parameters
215 <clang-tidy/checks/cppcoreguidelines/avoid-reference-coroutine-parameters>`
216 check to ignore false positives related to matching parameters of non
217 coroutine functions and increase issue detection for cases involving type
218 aliases with references.
220 - Improved :doc:`cppcoreguidelines-prefer-member-initializer
221 <clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check to
222 ignore delegate constructors.
224 - Improved :doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay
225 <clang-tidy/checks/cppcoreguidelines/pro-bounds-array-to-pointer-decay>` check
226 to ignore predefined expression (e.g., ``__func__``, ...).
228 - Improved :doc:`cppcoreguidelines-pro-bounds-constant-array-index
229 <clang-tidy/checks/cppcoreguidelines/pro-bounds-constant-array-index>` check
230 to perform checks on derived classes of ``std::array``.
232 - Improved :doc:`cppcoreguidelines-pro-type-member-init
233 <clang-tidy/checks/cppcoreguidelines/pro-type-member-init>` check to ignore
234 dependent delegate constructors.
236 - Improved :doc:`cppcoreguidelines-pro-type-vararg
237 <clang-tidy/checks/cppcoreguidelines/pro-type-vararg>` check to ignore
238 false-positives in unevaluated context (e.g., ``decltype``, ``sizeof``, ...).
240 - Improved :doc:`llvm-namespace-comment
241 <clang-tidy/checks/llvm/namespace-comment>` check to provide fixes for
242 ``inline`` namespaces in the same format as :program:`clang-format`.
244 - Improved :doc:`llvmlibc-callee-namespace
245 <clang-tidy/checks/llvmlibc/callee-namespace>` to support
246 customizable namespace. This matches the change made to implementation in
249 - Improved :doc:`llvmlibc-implementation-in-namespace
250 <clang-tidy/checks/llvmlibc/implementation-in-namespace>` to support
251 customizable namespace. This further allows for testing the libc when the
252 system-libc is also LLVM's libc.
254 - Improved :doc:`misc-const-correctness
255 <clang-tidy/checks/misc/const-correctness>` check to avoid false positive when
256 using pointer to member function.
258 - Improved :doc:`misc-include-cleaner
259 <clang-tidy/checks/misc/include-cleaner>` check by adding option
260 `DeduplicateFindings` to output one finding per symbol occurrence, avoid
261 inserting the same header multiple times, fix a bug where `IgnoreHeaders`
262 option won't work with verbatim/std headers.
264 - Improved :doc:`misc-redundant-expression
265 <clang-tidy/checks/misc/redundant-expression>` check to ignore
266 false-positives in unevaluated context (e.g., ``decltype``).
268 - Improved :doc:`modernize-loop-convert
269 <clang-tidy/checks/modernize/loop-convert>` to support for-loops with
270 iterators initialized by free functions like ``begin``, ``end``, or ``size``.
272 - Improved :doc:`modernize-return-braced-init-list
273 <clang-tidy/checks/modernize/return-braced-init-list>` check to ignore
274 false-positives when constructing the container with ``count`` copies of
275 elements with value ``value``.
277 - Improved :doc:`modernize-use-equals-delete
278 <clang-tidy/checks/modernize/use-equals-delete>` check to ignore
279 false-positives when special member function is actually used or implicit.
281 - Improved :doc:`modernize-use-nullptr
282 <clang-tidy/checks/modernize/use-nullptr>` check by adding option
283 `IgnoredTypes` that can be used to exclude some pointer types.
285 - Improved :doc:`modernize-use-std-print
286 <clang-tidy/checks/modernize/use-std-print>` check to accurately generate
287 fixes for reordering arguments.
289 - Improved :doc:`modernize-use-using
290 <clang-tidy/checks/modernize/use-using>` check to fix function pointer and
291 forward declared ``typedef`` correctly.
293 - Improved :doc:`performance-faster-string-find
294 <clang-tidy/checks/performance/faster-string-find>` check to properly escape
297 - Improved :doc:`performance-noexcept-move-constructor
298 <clang-tidy/checks/performance/noexcept-move-constructor>` to better handle
299 conditional noexcept expressions, eliminating false-positives.
301 - Improved :doc:`performance-noexcept-swap
302 <clang-tidy/checks/performance/noexcept-swap>` check to enforce a stricter
303 match with the swap function signature and better handling of condition
304 noexcept expressions, eliminating false-positives.
306 - Improved :doc:`readability-braces-around-statements
307 <clang-tidy/checks/readability/braces-around-statements>` check to
308 ignore false-positive for ``if constexpr`` in lambda expression.
310 - Improved :doc:`readability-container-size-empty
311 <clang-tidy/checks/readability/container-size-empty>` check to
312 detect comparison between string and empty string literals and support
313 ``length()`` method as an alternative to ``size()``.
315 - Improved :doc:`readability-function-size
316 <clang-tidy/checks/readability/function-size>` check configuration to use
317 `none` rather than `-1` to disable some parameters.
319 - Improved :doc:`readability-identifier-naming
320 <clang-tidy/checks/readability/identifier-naming>` check to issue accurate
321 warnings when a type's forward declaration precedes its definition.
322 Additionally, it now provides appropriate warnings for ``struct`` and
323 ``union`` in C, while also incorporating support for the
324 ``Leading_upper_snake_case`` naming convention. The handling of ``typedef``
325 has been enhanced, particularly within complex types like function pointers
326 and cases where style checks were omitted when functions started with macros.
328 - Improved :doc:`readability-implicit-bool-conversion
329 <clang-tidy/checks/readability/implicit-bool-conversion>` check to take
330 do-while loops into account for the `AllowIntegerConditions` and
331 `AllowPointerConditions` options.
333 - Improved :doc:`readability-non-const-parameter
334 <clang-tidy/checks/readability/non-const-parameter>` check to ignore
335 false-positives in initializer list of record.
337 - Improved :doc:`readability-static-accessed-through-instance
338 <clang-tidy/checks/readability/static-accessed-through-instance>` check to
339 identify calls to static member functions with out-of-class inline definitions.
344 Improvements to include-fixer
345 -----------------------------
347 The improvements are...
349 Improvements to clang-include-fixer
350 -----------------------------------
352 The improvements are...
354 Improvements to modularize
355 --------------------------
357 The improvements are...
359 Improvements to pp-trace
360 ------------------------
362 Clang-tidy Visual Studio plugin
363 -------------------------------