2019-07-18 19:51:05 +08:00
|
|
|
====================================================
|
2021-07-28 12:51:07 +08:00
|
|
|
Extra Clang Tools 14.0.0 (In-Progress) Release Notes
|
2019-07-18 19:51:05 +08:00
|
|
|
====================================================
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:local:
|
2016-03-30 20:05:33 +08:00
|
|
|
:depth: 3
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2018-09-10 16:52:04 +08:00
|
|
|
Written by the `LLVM Team <https://llvm.org/>`_
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
2021-07-28 12:51:07 +08:00
|
|
|
These are in-progress notes for the upcoming Extra Clang Tools 14 release.
|
2017-02-10 07:25:52 +08:00
|
|
|
Release notes for previous releases can be found on
|
2018-09-10 16:52:04 +08:00
|
|
|
`the Download Page <https://releases.llvm.org/download.html>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This document contains the release notes for the Extra Clang Tools, part of the
|
2021-07-28 12:51:07 +08:00
|
|
|
Clang release 14.0.0. Here we describe the status of the Extra Clang Tools in
|
2016-09-07 01:52:44 +08:00
|
|
|
some detail, including major improvements from the previous release and new
|
|
|
|
feature work. All LLVM releases may be downloaded from the `LLVM releases web
|
2018-09-10 16:52:04 +08:00
|
|
|
site <https://llvm.org/releases/>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
For more information about Clang or LLVM, including information about
|
2018-09-10 16:52:04 +08:00
|
|
|
the latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or
|
|
|
|
the `LLVM Web Site <https://llvm.org>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2020-01-15 17:02:56 +08:00
|
|
|
Note that if you are reading this file from a Git checkout or the
|
2016-03-27 13:06:57 +08:00
|
|
|
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
|
2018-09-10 16:52:04 +08:00
|
|
|
see the `releases page <https://llvm.org/releases/>`_.
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2021-07-28 12:51:07 +08:00
|
|
|
What's New in Extra Clang Tools 14.0.0?
|
2019-07-18 19:51:05 +08:00
|
|
|
=======================================
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
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
|
|
|
|
------------------
|
|
|
|
|
2016-07-19 02:08:59 +08:00
|
|
|
...
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2018-10-12 05:40:32 +08:00
|
|
|
Improvements to clangd
|
|
|
|
----------------------
|
|
|
|
|
2022-01-31 19:01:24 +08:00
|
|
|
- `clangd/inlayHints <https://clangd.llvm.org/extensions#inlay-hints>`_
|
2022-02-01 02:02:46 +08:00
|
|
|
LSP extension to provide information not directly available in code,
|
2022-01-31 19:01:24 +08:00
|
|
|
like parameter names, deduced types and designated initializers.
|
|
|
|
|
|
|
|
- Diagnostics and fixes for `unused include
|
|
|
|
<https://clangd.llvm.org/design/include-cleaner>`_ directives, according to
|
|
|
|
IWYU style. Off by default, can be turned on through
|
|
|
|
`Diagnostics.IncludeCleaner <https://clangd.llvm.org/config#unusedincludes>`_
|
|
|
|
config option.
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Support for ``textDocument/typeDefinition`` LSP request.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Relevant diagnostics are emitted with ``Deprecated`` and ``Unnecessary``
|
|
|
|
tags from LSP 3.15.
|
|
|
|
|
|
|
|
- Richer ``semanticTokens`` information for:
|
2022-01-31 19:01:24 +08:00
|
|
|
|
|
|
|
- Virtual methods
|
|
|
|
- Mutable reference arguments
|
|
|
|
- Lambda captures
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Support for attributes, (e.g. ``[[nodiscard, gsl::Owner(Foo)]]``) in various
|
2022-01-31 19:01:24 +08:00
|
|
|
features like hover, code completion, go-to-definition.
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- ``#pragma mark`` directives now show up in document outline.
|
|
|
|
|
|
|
|
- ``hover`` on include directives shows the resolved header path.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- ``hover`` on character literals shows their numeric value.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
|
|
|
- Include desugared types in hover, controlled with `Hover.ShowAKA
|
|
|
|
<https://clangd.llvm.org/config#showaka>`_ config option.
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Extra diagnostic fixes to insert includes:
|
|
|
|
|
|
|
|
- Includes are suggested in C even when an implicit declaration is generated.
|
|
|
|
- Incomplete types (some additional cases).
|
2022-01-31 19:01:24 +08:00
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Code completion for ``/*ParameterName=*/`` commetns.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
|
|
|
- Provide and improve signature help for:
|
2022-02-01 02:02:46 +08:00
|
|
|
|
2022-01-31 19:01:24 +08:00
|
|
|
- Variadic functions
|
|
|
|
- Template argument lists
|
|
|
|
- Braced constructor calls
|
|
|
|
- Aggregate initializers
|
|
|
|
- Constructor initializers
|
|
|
|
|
|
|
|
- Improved handling of short identifiers in code completion and workspace symbol
|
|
|
|
requests.
|
|
|
|
|
|
|
|
- Improved handling of symbols introduced via using declarations.
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Provide extra warnings specified in ``.clang-tidy`` config files by
|
|
|
|
``ExtraArgs(Before)`` sections.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
|
|
|
- `CompileFlags.Compiler <https://clangd.llvm.org/config#compiler>`_ config
|
|
|
|
option to override executable name in compile flags.
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Compile flags like ``-xc++-header`` that must precede input file names are now
|
|
|
|
added correctly by the
|
2022-01-31 19:01:24 +08:00
|
|
|
`CompileFlags.Add <https://clangd.llvm.org/config#add>`_ config option.
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- The "populate switch" code action is now offered as a fix for ``-Wswitch``
|
|
|
|
warnings, and works with C/ObjC enums.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- ``clangd --check=/path/to/file.cpp`` now reads config files in ancestor
|
2022-01-31 19:01:24 +08:00
|
|
|
directories, in addition to user config file.
|
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- Improved compile flags handling in ``clangd-indexer``.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
2022-02-01 02:02:46 +08:00
|
|
|
- ``-use-dirty-headers`` command line flag to use dirty buffer contents when
|
|
|
|
parsing headers, rather than the saved on-disk contents.
|
2022-01-31 19:01:24 +08:00
|
|
|
|
|
|
|
- Improved handling of ObjC/ObjC++ constructs.
|
|
|
|
|
|
|
|
- Include request context on crashes when possible.
|
|
|
|
|
|
|
|
- Various stability and performance improvements.
|
2018-10-12 05:40:32 +08:00
|
|
|
|
|
|
|
Improvements to clang-doc
|
|
|
|
-------------------------
|
|
|
|
|
2020-01-15 17:02:56 +08:00
|
|
|
The improvements are...
|
2018-10-12 05:40:32 +08:00
|
|
|
|
2016-03-30 20:05:33 +08:00
|
|
|
Improvements to clang-query
|
|
|
|
---------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2021-01-27 11:37:08 +08:00
|
|
|
The improvements are...
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2016-03-30 20:05:33 +08:00
|
|
|
Improvements to clang-rename
|
|
|
|
----------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2017-01-13 05:58:40 +08:00
|
|
|
The improvements are...
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2016-03-30 20:05:33 +08:00
|
|
|
Improvements to clang-tidy
|
|
|
|
--------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
2021-12-29 22:42:30 +08:00
|
|
|
- Ignore warnings from macros defined in system headers, if not using the
|
|
|
|
`-system-headers` flag.
|
|
|
|
|
2021-10-06 14:17:13 +08:00
|
|
|
- Added support for globbing in `NOLINT*` expressions, to simplify suppressing
|
|
|
|
multiple warnings in the same line.
|
|
|
|
|
2021-09-29 19:59:04 +08:00
|
|
|
- Added support for `NOLINTBEGIN` ... `NOLINTEND` comments to suppress
|
|
|
|
Clang-Tidy warnings over multiple lines.
|
2021-03-16 00:06:03 +08:00
|
|
|
|
2021-02-22 18:46:36 +08:00
|
|
|
New checks
|
|
|
|
^^^^^^^^^^
|
|
|
|
|
2021-11-08 23:40:18 +08:00
|
|
|
- New :doc:`abseil-cleanup-ctad
|
|
|
|
<clang-tidy/checks/abseil-cleanup-ctad>` check.
|
|
|
|
|
|
|
|
Suggests switching the initialization pattern of ``absl::Cleanup``
|
|
|
|
instances from the factory function to class template argument
|
|
|
|
deduction (CTAD), in C++17 and higher.
|
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- New :doc:`bugprone-stringview-nullptr
|
|
|
|
<clang-tidy/checks/bugprone-stringview-nullptr>` check.
|
|
|
|
|
|
|
|
Checks for various ways that the ``const CharT*`` constructor of
|
|
|
|
``std::basic_string_view`` can be passed a null argument.
|
|
|
|
|
2021-08-26 02:22:15 +08:00
|
|
|
- New :doc:`bugprone-suspicious-memory-comparison
|
|
|
|
<clang-tidy/checks/bugprone-suspicious-memory-comparison>` check.
|
|
|
|
|
2021-08-09 20:08:00 +08:00
|
|
|
Finds potentially incorrect calls to ``memcmp()`` based on properties of the
|
|
|
|
arguments.
|
|
|
|
|
|
|
|
- New :doc:`cppcoreguidelines-virtual-class-destructor
|
|
|
|
<clang-tidy/checks/cppcoreguidelines-virtual-class-destructor>` check.
|
|
|
|
|
|
|
|
Finds virtual classes whose destructor is neither public and virtual nor
|
|
|
|
protected and non-virtual.
|
2021-08-26 02:22:15 +08:00
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- New :doc:`misc-misleading-bidirectional <clang-tidy/checks/misc-misleading-bidirectional>` check.
|
|
|
|
|
|
|
|
Inspects string literal and comments for unterminated bidirectional Unicode
|
|
|
|
characters.
|
|
|
|
|
2021-11-10 17:16:06 +08:00
|
|
|
- New :doc:`misc-misleading-identifier <clang-tidy/checks/misc-misleading-identifier>` check.
|
2021-08-12 23:31:26 +08:00
|
|
|
|
2021-11-10 17:16:06 +08:00
|
|
|
Reports identifier with unicode right-to-left characters.
|
2021-08-09 20:08:00 +08:00
|
|
|
|
2021-10-28 02:49:00 +08:00
|
|
|
- New :doc:`readability-container-contains
|
|
|
|
<clang-tidy/checks/readability-container-contains>` check.
|
|
|
|
|
|
|
|
Finds usages of ``container.count()`` and ``container.find() == container.end()`` which should
|
|
|
|
be replaced by a call to the ``container.contains()`` method introduced in C++20.
|
|
|
|
|
2021-11-10 17:16:06 +08:00
|
|
|
- New :doc:`readability-container-data-pointer
|
|
|
|
<clang-tidy/checks/readability-container-data-pointer>` check.
|
2021-09-16 04:07:51 +08:00
|
|
|
|
|
|
|
Finds cases where code could use ``data()`` rather than the address of the
|
|
|
|
element at index 0 in a container.
|
|
|
|
|
2022-01-02 13:47:22 +08:00
|
|
|
- New :doc:`readability-duplicate-include
|
|
|
|
<clang-tidy/checks/readability-duplicate-include>` check.
|
|
|
|
|
2022-01-15 21:07:51 +08:00
|
|
|
Looks for duplicate includes and removes them.
|
2022-01-02 13:47:22 +08:00
|
|
|
|
2021-11-10 17:16:06 +08:00
|
|
|
- New :doc:`readability-identifier-length
|
|
|
|
<clang-tidy/checks/readability-identifier-length>` check.
|
|
|
|
|
|
|
|
Reports identifiers whose names are too short. Currently checks local
|
|
|
|
variables and function parameters only.
|
2021-10-15 21:18:52 +08:00
|
|
|
|
2021-02-22 18:46:36 +08:00
|
|
|
New check aliases
|
|
|
|
^^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-11-02 17:30:14 +08:00
|
|
|
- New alias :doc:`cert-err33-c
|
|
|
|
<clang-tidy/checks/cert-err33-c>` to
|
|
|
|
:doc:`bugprone-unused-return-value
|
|
|
|
<clang-tidy/checks/bugprone-unused-return-value>` was added.
|
|
|
|
|
2021-08-26 02:22:15 +08:00
|
|
|
- New alias :doc:`cert-exp42-c
|
|
|
|
<clang-tidy/checks/cert-exp42-c>` to
|
|
|
|
:doc:`bugprone-suspicious-memory-comparison
|
|
|
|
<clang-tidy/checks/bugprone-suspicious-memory-comparison>` was added.
|
|
|
|
|
|
|
|
- New alias :doc:`cert-flp37-c
|
|
|
|
<clang-tidy/checks/cert-flp37-c>` to
|
|
|
|
:doc:`bugprone-suspicious-memory-comparison
|
|
|
|
<clang-tidy/checks/bugprone-suspicious-memory-comparison>` was added.
|
|
|
|
|
2021-02-23 00:16:51 +08:00
|
|
|
Changes in existing checks
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- :doc:`bugprone-assert-side-effect
|
|
|
|
<clang-tidy/checks/bugprone-assert-side-effect>` check now supports an
|
|
|
|
``IgnoredFunctions`` option to explicitly consider the specified
|
|
|
|
semicolon-separated functions list as not having any side-effects.
|
|
|
|
Regular expressions for the list items are also accepted.
|
|
|
|
|
|
|
|
- Fixed a false positive in :doc:`bugprone-throw-keyword-missing
|
|
|
|
<clang-tidy/checks/bugprone-throw-keyword-missing>` when creating an
|
|
|
|
exception object using placement new.
|
2022-01-15 21:07:51 +08:00
|
|
|
|
2021-11-23 17:27:23 +08:00
|
|
|
- Removed default setting ``cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors = "true"``,
|
2022-01-29 09:14:33 +08:00
|
|
|
from :doc:`cppcoreguidelines-explicit-virtual-functions
|
|
|
|
<clang-tidy/checks/cppcoreguidelines-explicit-virtual-functions>`
|
2021-10-12 22:05:43 +08:00
|
|
|
to match the current state of the C++ Core Guidelines.
|
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- Eliminated false positives for :doc:`cppcoreguidelines-macro-usage
|
|
|
|
<clang-tidy/checks/cppcoreguidelines-macro-usage>` by restricting
|
|
|
|
the warning about using constants to only macros that expand to literals.
|
2022-01-21 15:59:27 +08:00
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- :doc:`cppcoreguidelines-narrowing-conversions
|
|
|
|
<clang-tidy/checks/cppcoreguidelines-narrowing-conversions>`
|
|
|
|
check now supports a ``WarnOnIntegerToFloatingPointNarrowingConversion``
|
|
|
|
option to control whether to warn on narrowing integer to floating-point
|
|
|
|
conversions.
|
|
|
|
|
|
|
|
- Make the :doc:`cppcoreguidelines-pro-bounds-array-to-pointer-decay
|
|
|
|
<clang-tidy/checks/cppcoreguidelines-pro-bounds-array-to-pointer-decay>`
|
|
|
|
check accept string literal to pointer decay in conditional operator even
|
|
|
|
if operands are of the same length.
|
|
|
|
|
|
|
|
- Removed suggestion ``use gsl::at`` from warning message in the
|
|
|
|
:doc:`cppcoreguidelines-pro-bounds-constant-array-index
|
|
|
|
<clang-tidy/checks/cppcoreguidelines-pro-bounds-constant-array-index>`
|
|
|
|
check, since that is not a requirement from the C++ Core Guidelines.
|
|
|
|
This allows people to choose their own safe indexing strategy. The
|
|
|
|
fix-it is kept for those who want to use the GSL library.
|
2021-10-12 22:05:43 +08:00
|
|
|
|
2021-12-02 04:28:01 +08:00
|
|
|
- Fixed a false positive in :doc:`fuchsia-trailing-return
|
|
|
|
<clang-tidy/checks/fuchsia-trailing-return>` for C++17 deduction guides.
|
2021-12-29 22:42:30 +08:00
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- Updated :doc:`google-readability-casting
|
|
|
|
<clang-tidy/checks/google-readability-casting>` to diagnose and fix
|
|
|
|
functional casts, to achieve feature parity with the corresponding
|
|
|
|
``cpplint.py`` check.
|
2021-12-02 04:28:01 +08:00
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- Generalized the :doc:`modernize-use-default-member-init
|
|
|
|
<clang-tidy/checks/modernize-use-default-member-init>` check to handle
|
|
|
|
non-default constructors.
|
|
|
|
|
|
|
|
- Improved :doc:`performance-move-const-arg
|
|
|
|
<clang-tidy/checks/performance-move-const-arg>` check.
|
2021-12-16 21:24:09 +08:00
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
Removed a wrong FixIt for trivially copyable objects wrapped by
|
|
|
|
``std::move()`` and passed to an rvalue reference parameter. Removal of
|
|
|
|
``std::move()`` would break the code.
|
2022-01-21 14:23:52 +08:00
|
|
|
|
2022-01-29 09:14:33 +08:00
|
|
|
- :doc:`readability-simplify-boolean-expr
|
|
|
|
<clang-tidy/checks/readability-simplify-boolean-expr>` now simplifies
|
|
|
|
return statements associated with ``case``, ``default`` and labeled
|
|
|
|
statements.
|
2021-12-16 21:24:09 +08:00
|
|
|
|
2021-03-16 22:03:29 +08:00
|
|
|
Removed checks
|
|
|
|
^^^^^^^^^^^^^^
|
2021-03-04 00:01:12 +08:00
|
|
|
|
2019-10-31 01:48:26 +08:00
|
|
|
Improvements to include-fixer
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
The improvements are...
|
|
|
|
|
2019-03-25 22:09:10 +08:00
|
|
|
Improvements to clang-include-fixer
|
2019-03-26 00:50:24 +08:00
|
|
|
-----------------------------------
|
2016-03-30 20:05:33 +08:00
|
|
|
|
2017-01-13 05:58:40 +08:00
|
|
|
The improvements are...
|
2016-03-30 20:05:33 +08:00
|
|
|
|
|
|
|
Improvements to modularize
|
|
|
|
--------------------------
|
2016-03-27 13:06:57 +08:00
|
|
|
|
|
|
|
The improvements are...
|
[pp-trace] Delete -ignore and add a new option -callbacks
Summary:
-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.
-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'
-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...
Reviewers: juliehockett, aaron.ballman, alexfh, ioeric
Reviewed By: aaron.ballman
Subscribers: nemanjai, kbarton, jsji, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59296
llvm-svn: 356366
2019-03-18 21:30:17 +08:00
|
|
|
|
|
|
|
Improvements to pp-trace
|
|
|
|
------------------------
|
|
|
|
|
2019-07-18 19:51:05 +08:00
|
|
|
The improvements are...
|
2019-08-28 02:36:08 +08:00
|
|
|
|
2021-12-14 08:08:18 +08:00
|
|
|
Clang-tidy Visual Studio plugin
|
2019-08-28 02:36:08 +08:00
|
|
|
-------------------------------
|