1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
|
====================================================
Extra Clang Tools |release| |ReleaseNotesTitle|
====================================================
.. contents::
:local:
:depth: 3
Written by the `LLVM Team <https://llvm.org/>`_
Introduction
============
This document contains the release notes for the Extra Clang Tools, part of the
Clang release |release|. Here we describe the status of the Extra Clang Tools in
some detail, including major improvements from the previous release and new
feature work. All LLVM releases may be downloaded from the `LLVM releases web
site <https://llvm.org/releases/>`_.
For more information about Clang or LLVM, including information about
the latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or
the `LLVM Web Site <https://llvm.org>`_.
Note that if you are reading this file from a Git checkout or the
main Clang web page, this document applies to the *next* release, not
the current one. To see the release notes for a specific release, please
see the `releases page <https://llvm.org/releases/>`_.
What's New in Extra Clang Tools |release|?
==========================================
Some of the major new features and improvements to Extra Clang Tools are listed
here. Generic improvements to Extra Clang Tools as a whole or to its underlying
infrastructure are described first, followed by tool-specific sections.
Major New Features
------------------
...
Improvements to clangd
----------------------
Inlay hints
^^^^^^^^^^^
- Provide hints for:
- Lambda return types.
- Forwarding functions using the underlying function call.
- Support for standard LSP 3.17 inlay hints protocol.
- Designator inlay hints are enabled by default.
Diagnostics
^^^^^^^^^^^
- Improved Fix-its of some clang-tidy checks when applied with clangd.
- Clangd now produces diagnostics for forwarding functions like make_unique.
- Include cleaner analysis can be disabled with the ``Diagnostics.Includes.IgnoreHeader`` config option.
- Include cleaner doesn’t diagnose exporting headers.
- clang-tidy and include cleaner diagnostics have links to their documentation.
Semantic Highlighting
^^^^^^^^^^^^^^^^^^^^^
- Semantic highlighting works for tokens that span multiple lines.
- Mutable reference parameters in function calls receive ``usedAsMutableReference`` modifier.
Hover
^^^^^
- Hover displays desugared types by default now.
Code completion
^^^^^^^^^^^^^^^
- Improved ranking/filtering for ObjC method selectors.
- Support for C++20 concepts and requires expressions.
Signature help
^^^^^^^^^^^^^^
- Signature help for function pointers.
- Provides hints using underlying functions in forwarded calls.
Cross-references
^^^^^^^^^^^^^^^^
Code Actions
^^^^^^^^^^^^
- New code action to generate ObjC initializers.
- New code action to generate move/copy constructors/assignments.
- Extract to function works for methods in addition to free functions.
- Related diagnostics are attached to code actions response, if any.
- Extract variable works in C and ObjC files.
- Fix to define outline when the parameter has a braced initializer.
Miscellaneous
^^^^^^^^^^^^^
- Include fixer supports symbols inside macro arguments.
- Dependent autos are now deduced when there’s a single instantiation.
- Support for symbols exported with using declarations in all features.
- Fixed background-indexing priority for M1 chips.
- Indexing for standard library symbols.
- ObjC framework includes are spelled properly during include insertion operations.
Improvements to clang-doc
-------------------------
The improvements are...
Improvements to clang-query
---------------------------
The improvements are...
Improvements to clang-rename
----------------------------
The improvements are...
Improvements to clang-tidy
--------------------------
- Added trace code to help narrow down any checks and the relevant source code
that result in crashes.
- Clang-tidy now consideres newlines as separators of single elements in the `Checks` section in
`.clang-tidy` configuration files. Where previously a comma had to be used to distinguish elements in
this list from each other, newline characters now also work as separators in the parsed YAML. That
means it is advised to use YAML's block style initiated by the pipe character `|` for the `Checks`
section in order to benefit from the easier syntax that works without commas.
- Fixed a regression introduced in clang-tidy 14.0.0, which prevented NOLINTs
from suppressing diagnostics associated with macro arguments. This fixes
`Issue 55134 <https://github.com/llvm/llvm-project/issues/55134>`_.
- Added an option -verify-config which will check the config file to ensure each
`Checks` and `CheckOptions` entries are recognised.
- .clang-tidy files can now use the more natural dictionary syntax for specifying `CheckOptions`.
New checks
^^^^^^^^^^
- New :doc:`bugprone-shared-ptr-array-mismatch <clang-tidy/checks/bugprone/shared-ptr-array-mismatch>` check.
Finds initializations of C++ shared pointers to non-array type that are initialized with an array.
- New :doc:`bugprone-unchecked-optional-access
<clang-tidy/checks/bugprone/unchecked-optional-access>` check.
Warns when the code is unwrapping a `std::optional<T>`, `absl::optional<T>`,
or `base::Optional<T>` object without assuring that it contains a value.
- New :doc:`misc-confusable-identifiers <clang-tidy/checks/misc/confusable-identifiers>` check.
Detects confusable Unicode identifiers.
- New :doc:`bugprone-assignment-in-if-condition
<clang-tidy/checks/bugprone/assignment-in-if-condition>` check.
Warns when there is an assignment within an if statement condition expression.
- New :doc:`misc-const-correctness
<clang-tidy/checks/misc/const-correctness>` check.
Detects unmodified local variables and suggest adding ``const`` if the transformation is possible.
- New :doc:`modernize-macro-to-enum
<clang-tidy/checks/modernize/macro-to-enum>` check.
Replaces groups of adjacent macros with an unscoped anonymous enum.
- New :doc:`portability-std-allocator-const <clang-tidy/checks/portability/std-allocator-const>` check.
Report use of ``std::vector<const T>`` (and similar containers of const
elements). These are not allowed in standard C++ due to undefined
``std::allocator<const T>``. They do not compile with libstdc++ or MSVC.
Future libc++ will remove the extension (`D120996
<https://reviews.llvm.org/D120996>`).
New check aliases
^^^^^^^^^^^^^^^^^
- New alias :doc:`cppcoreguidelines-macro-to-enum
<clang-tidy/checks/cppcoreguidelines/macro-to-enum>` to :doc:`modernize-macro-to-enum
<clang-tidy/checks/modernize/macro-to-enum>` was added.
Changes in existing checks
^^^^^^^^^^^^^^^^^^^^^^^^^^
- Fixed nonsensical suggestion of :doc:`altera-struct-pack-align
<clang-tidy/checks/altera/struct-pack-align>` check for empty structs.
- Fixed a false positive in :doc:`bugprone-branch-clone
<clang-tidy/checks/bugprone/branch-clone>` when the branches
involve unknown expressions.
- Fixed some false positives in :doc:`bugprone-infinite-loop
<clang-tidy/checks/bugprone/infinite-loop>` involving dependent expressions.
- Fixed a crash in :doc:`bugprone-sizeof-expression
<clang-tidy/checks/bugprone/sizeof-expression>` when `sizeof(...)` is
compared against a `__int128_t`.
- Fixed bugs in :doc:`bugprone-use-after-move
<clang-tidy/checks/bugprone/use-after-move>`:
- Treat a move in a lambda capture as happening in the function that defines
the lambda, not within the body of the lambda (as we were previously doing
erroneously).
- Don't emit an erroneous warning on self-moves.
- Improved :doc:`cert-dcl58-cpp
<clang-tidy/checks/cert/dcl58-cpp>` check.
The check now detects explicit template specializations that are handled specially.
- Made :doc:`cert-oop57-cpp <clang-tidy/checks/cert/oop57-cpp>` more sensitive
by checking for an arbitrary expression in the second argument of ``memset``.
- Made the fix-it of :doc:`cppcoreguidelines-init-variables
<clang-tidy/checks/cppcoreguidelines/init-variables>` use ``false`` to initialize
boolean variables.
- Improved :doc:`cppcoreguidelines-prefer-member-initializer
<clang-tidy/checks/cppcoreguidelines/prefer-member-initializer>` check.
Fixed an issue when there was already an initializer in the constructor and
the check would try to create another initializer for the same member.
- Fixed a false positive in :doc:`cppcoreguidelines-virtual-class-destructor
<clang-tidy/checks/cppcoreguidelines/virtual-class-destructor>` involving
``final`` classes. The check will not diagnose classes marked ``final``, since
those cannot be used as base classes, consequently, they can not violate the
rule.
- Fixed a crash in :doc:`llvmlibc-callee-namespace
<clang-tidy/checks/llvmlibc/callee-namespace>` when executing for C++ code
that contain calls to advanced constructs, e.g. overloaded operators.
- Fixed false positives in :doc:`misc-redundant-expression
<clang-tidy/checks/misc/redundant-expression>`:
- Fixed a false positive involving overloaded comparison operators.
- Fixed a false positive involving assignments in
conditions. This fixes `Issue 35853 <https://github.com/llvm/llvm-project/issues/35853>`_.
- Fixed a false positive in :doc:`misc-unused-parameters
<clang-tidy/checks/misc/unused-parameters>`
where invalid parameters were implicitly being treated as being unused.
This fixes `Issue 56152 <https://github.com/llvm/llvm-project/issues/56152>`_.
- Fixed false positives in :doc:`misc-unused-using-decls
<clang-tidy/checks/misc/unused-using-decls>` where `using` statements bringing
operators into the scope where incorrectly marked as unused.
This fixes `issue 55095 <https://github.com/llvm/llvm-project/issues/55095>`_.
- Fixed a false positive in :doc:`modernize-deprecated-headers
<clang-tidy/checks/modernize/deprecated-headers>` involving including
C header files from C++ files wrapped by ``extern "C" { ... }`` blocks.
Such includes will be ignored by now.
By default now it doesn't warn for including deprecated headers from header
files, since that header file might be used from C source files. By passing
the ``CheckHeaderFile=true`` option if header files of the project only
included by C++ source files.
- Improved :doc:`performance-inefficient-vector-operation
<clang-tidy/checks/performance/inefficient-vector-operation>` to work when
the vector is a member of a structure.
- Fixed a crash in :doc:`performance-unnecessary-value-param
<clang-tidy/checks/performance/unnecessary-value-param>` when the specialization
template has an unnecessary value parameter. Removed the fix for a template.
- Fixed a crash in :doc:`readability-const-return-type
<clang-tidy/checks/readability/const-return-type>` when a pure virtual function
overrided has a const return type. Removed the fix for a virtual function.
- Skipped addition of extra parentheses around member accesses (``a.b``) in fix-it for
:doc:`readability-container-data-pointer <clang-tidy/checks/readability/container-data-pointer>`.
- Fixed incorrect suggestions for :doc:`readability-container-size-empty
<clang-tidy/checks/readability/container-size-empty>` when smart pointers are involved.
- Fixed a false positive in :doc:`readability-non-const-parameter
<clang-tidy/checks/readability/non-const-parameter>` when the parameter is
referenced by an lvalue.
- Expanded :doc:`readability-simplify-boolean-expr
<clang-tidy/checks/readability/simplify-boolean-expr>` to simplify expressions
using DeMorgan's Theorem.
Removed checks
^^^^^^^^^^^^^^
Improvements to include-fixer
-----------------------------
The improvements are...
Improvements to clang-include-fixer
-----------------------------------
The improvements are...
Improvements to modularize
--------------------------
The improvements are...
Improvements to pp-trace
------------------------
- Added `HashLoc` information to `InclusionDirective` callback output.
Clang-tidy Visual Studio plugin
-------------------------------
|