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 ----------------------
56 - Improved Fix-its of some clang-tidy checks when applied with clangd.
82 Improvements to clang-doc
83 -------------------------
85 The improvements are...
87 Improvements to clang-query
88 ---------------------------
90 The improvements are...
92 Improvements to clang-rename
93 ----------------------------
95 The improvements are...
97 Improvements to clang-tidy
98 --------------------------
100 - Added trace code to help narrow down any checks and the relevant source code
101 that result in crashes.
103 - Clang-tidy now consideres newlines as separators of single elements in the `Checks` section in
104 `.clang-tidy` configuration files. Where previously a comma had to be used to distinguish elements in
105 this list from each other, newline characters now also work as separators in the parsed YAML. That
106 means it is advised to use YAML's block style initiated by the pipe character `|` for the `Checks`
107 section in order to benefit from the easier syntax that works without commas.
109 - Fixed a regression introduced in clang-tidy 14.0.0, which prevented NOLINTs
110 from suppressing diagnostics associated with macro arguments. This fixes
111 `Issue 55134 <https://github.com/llvm/llvm-project/issues/55134>`_.
113 - Added an option -verify-config which will check the config file to ensure each
114 `Checks` and `CheckOptions` entries are recognised.
116 - .clang-tidy files can now use the more natural dictionary syntax for specifying `CheckOptions`.
121 - New :doc:`bugprone-shared-ptr-array-mismatch <clang-tidy/checks/bugprone/shared-ptr-array-mismatch>` check.
123 Finds initializations of C++ shared pointers to non-array type that are initialized with an array.
125 - New :doc:`bugprone-unchecked-optional-access
126 <clang-tidy/checks/bugprone/unchecked-optional-access>` check.
128 Warns when the code is unwrapping a `std::optional<T>`, `absl::optional<T>`,
129 or `base::Optional<T>` object without assuring that it contains a value.
131 - New :doc:`misc-confusable-identifiers <clang-tidy/checks/misc/confusable-identifiers>` check.
133 Detects confusable Unicode identifiers.
135 - New :doc:`bugprone-assignment-in-if-condition
136 <clang-tidy/checks/bugprone/assignment-in-if-condition>` check.
138 Warns when there is an assignment within an if statement condition expression.
140 - New :doc:`modernize-macro-to-enum
141 <clang-tidy/checks/modernize/macro-to-enum>` check.
143 Replaces groups of adjacent macros with an unscoped anonymous enum.
145 - New :doc:`portability-std-allocator-const <clang-tidy/checks/portability/std-allocator-const>` check.
147 Report use of ``std::vector<const T>`` (and similar containers of const
148 elements). These are not allowed in standard C++ due to undefined
149 ``std::allocator<const T>``. They do not compile with libstdc++ or MSVC.
150 Future libc++ will remove the extension (`D120996
151 <https://reviews.llvm.org/D120996>`).
156 - New alias :doc:`cppcoreguidelines-macro-to-enum
157 <clang-tidy/checks/cppcoreguidelines/macro-to-enum>` to :doc:`modernize-macro-to-enum
158 <clang-tidy/checks/modernize/macro-to-enum>` was added.
160 Changes in existing checks
161 ^^^^^^^^^^^^^^^^^^^^^^^^^^
163 - Fixed nonsensical suggestion of :doc:`altera-struct-pack-align
164 <clang-tidy/checks/altera/struct-pack-align>` check for empty structs.
166 - Fixed a false positive in :doc:`bugprone-branch-clone
167 <clang-tidy/checks/bugprone/branch-clone>` when the branches
168 involve unknown expressions.
170 - Fixed some false positives in :doc:`bugprone-infinite-loop
171 <clang-tidy/checks/bugprone/infinite-loop>` involving dependent expressions.
173 - Fixed a crash in :doc:`bugprone-sizeof-expression
174 <clang-tidy/checks/bugprone/sizeof-expression>` when `sizeof(...)` is
175 compared against a `__int128_t`.
177 - Fixed bugs in :doc:`bugprone-use-after-move
178 <clang-tidy/checks/bugprone/use-after-move>`:
180 - Treat a move in a lambda capture as happening in the function that defines
181 the lambda, not within the body of the lambda (as we were previously doing
184 - Don't emit an erroneous warning on self-moves.
186 - Improved :doc:`cert-dcl58-cpp
187 <clang-tidy/checks/cert/dcl58-cpp>` check.
189 The check now detects explicit template specializations that are handled specially.
191 - Made :doc:`cert-oop57-cpp <clang-tidy/checks/cert/oop57-cpp>` more sensitive
192 by checking for an arbitrary expression in the second argument of ``memset``.
194 - Made the fix-it of :doc:`cppcoreguidelines-init-variables
195 <clang-tidy/checks/cppcoreguidelines/init-variables>` use ``false`` to initialize
198 - Improved :doc:`cppcoreguidelines-prefer-member-initializer
199 <clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check.
201 Fixed an issue when there was already an initializer in the constructor and
202 the check would try to create another initializer for the same member.
204 - Fixed a false positive in :doc:`cppcoreguidelines-virtual-class-destructor
205 <clang-tidy/checks/cppcoreguidelines/virtual-class-destructor>` involving
206 ``final`` classes. The check will not diagnose classes marked ``final``, since
207 those cannot be used as base classes, consequently, they can not violate the
210 - Fixed a crash in :doc:`llvmlibc-callee-namespace
211 <clang-tidy/checks/llvmlibc/callee-namespace>` when executing for C++ code
212 that contain calls to advanced constructs, e.g. overloaded operators.
214 - Fixed false positives in :doc:`misc-redundant-expression
215 <clang-tidy/checks/misc/redundant-expression>`:
217 - Fixed a false positive involving overloaded comparison operators.
219 - Fixed a false positive involving assignments in
220 conditions. This fixes `Issue 35853 <https://github.com/llvm/llvm-project/issues/35853>`_.
222 - Fixed a false positive in :doc:`misc-unused-parameters
223 <clang-tidy/checks/misc/unused-parameters>`
224 where invalid parameters were implicitly being treated as being unused.
225 This fixes `Issue 56152 <https://github.com/llvm/llvm-project/issues/56152>`_.
227 - Fixed a false positive in :doc:`modernize-deprecated-headers
228 <clang-tidy/checks/modernize/deprecated-headers>` involving including
229 C header files from C++ files wrapped by ``extern "C" { ... }`` blocks.
230 Such includes will be ignored by now.
231 By default now it doesn't warn for including deprecated headers from header
232 files, since that header file might be used from C source files. By passing
233 the ``CheckHeaderFile=true`` option if header files of the project only
234 included by C++ source files.
236 - Improved :doc:`performance-inefficient-vector-operation
237 <clang-tidy/checks/performance/inefficient-vector-operation>` to work when
238 the vector is a member of a structure.
240 - Fixed a crash in :doc:`performance-unnecessary-value-param
241 <clang-tidy/checks/performance/unnecessary-value-param>` when the specialization
242 template has an unnecessary value parameter. Removed the fix for a template.
244 - Fixed a crash in :doc:`readability-const-return-type
245 <clang-tidy/checks/readability/const-return-type>` when a pure virtual function
246 overrided has a const return type. Removed the fix for a virtual function.
248 - Fixed incorrect suggestions for :doc:`readability-container-size-empty
249 <clang-tidy/checks/readability/container-size-empty>` when smart pointers are involved.
251 - Fixed a false positive in :doc:`readability-non-const-parameter
252 <clang-tidy/checks/readability/non-const-parameter>` when the parameter is
253 referenced by an lvalue.
255 - Expanded :doc:`readability-simplify-boolean-expr
256 <clang-tidy/checks/readability/simplify-boolean-expr>` to simplify expressions
257 using DeMorgan's Theorem.
262 Improvements to include-fixer
263 -----------------------------
265 The improvements are...
267 Improvements to clang-include-fixer
268 -----------------------------------
270 The improvements are...
272 Improvements to modularize
273 --------------------------
275 The improvements are...
277 Improvements to pp-trace
278 ------------------------
280 - Added `HashLoc` information to `InclusionDirective` callback output.
282 Clang-tidy Visual Studio plugin
283 -------------------------------