1==================================================== 2Extra Clang Tools |release| |ReleaseNotesTitle| 3==================================================== 4 5.. contents:: 6 :local: 7 :depth: 3 8 9Written by the `LLVM Team <https://llvm.org/>`_ 10 11.. only:: PreRelease 12 13 .. warning:: 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>`_. 17 18Introduction 19============ 20 21This document contains the release notes for the Extra Clang Tools, part of the 22Clang release |release|. Here we describe the status of the Extra Clang Tools in 23some detail, including major improvements from the previous release and new 24feature work. All LLVM releases may be downloaded from the `LLVM releases web 25site <https://llvm.org/releases/>`_. 26 27For more information about Clang or LLVM, including information about 28the latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or 29the `LLVM Web Site <https://llvm.org>`_. 30 31Note that if you are reading this file from a Git checkout or the 32main Clang web page, this document applies to the *next* release, not 33the current one. To see the release notes for a specific release, please 34see the `releases page <https://llvm.org/releases/>`_. 35 36What's New in Extra Clang Tools |release|? 37========================================== 38 39Some of the major new features and improvements to Extra Clang Tools are listed 40here. Generic improvements to Extra Clang Tools as a whole or to its underlying 41infrastructure are described first, followed by tool-specific sections. 42 43Major New Features 44------------------ 45 46... 47 48Improvements to clangd 49---------------------- 50 51Inlay hints 52^^^^^^^^^^^ 53 54Diagnostics 55^^^^^^^^^^^ 56- Improved Fix-its of some clang-tidy checks when applied with clangd. 57 58Semantic Highlighting 59^^^^^^^^^^^^^^^^^^^^^ 60 61Compile flags 62^^^^^^^^^^^^^ 63 64Hover 65^^^^^ 66 67Code completion 68^^^^^^^^^^^^^^^ 69 70Signature help 71^^^^^^^^^^^^^^ 72 73Cross-references 74^^^^^^^^^^^^^^^^ 75 76Objective-C 77^^^^^^^^^^^ 78 79Miscellaneous 80^^^^^^^^^^^^^ 81 82Improvements to clang-doc 83------------------------- 84 85The improvements are... 86 87Improvements to clang-query 88--------------------------- 89 90The improvements are... 91 92Improvements to clang-rename 93---------------------------- 94 95The improvements are... 96 97Improvements to clang-tidy 98-------------------------- 99 100- Added trace code to help narrow down any checks and the relevant source code 101 that result in crashes. 102 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. 108 109New checks 110^^^^^^^^^^ 111 112- New :doc:`bugprone-shared-ptr-array-mismatch <clang-tidy/checks/bugprone-shared-ptr-array-mismatch>` check. 113 114 Finds initializations of C++ shared pointers to non-array type that are initialized with an array. 115 116- New :doc:`bugprone-unchecked-optional-access 117 <clang-tidy/checks/bugprone-unchecked-optional-access>` check. 118 119 Warns when the code is unwrapping a `std::optional<T>`, `absl::optional<T>`, 120 or `base::Optional<T>` object without assuring that it contains a value. 121 122- New :doc:`modernize-macro-to-enum 123 <clang-tidy/checks/modernize-macro-to-enum>` check. 124 125 Replaces groups of adjacent macros with an unscoped anonymous enum. 126 127- New :doc:`portability-std-allocator-const <clang-tidy/checks/portability-std-allocator-const>` check. 128 129 Report use of ``std::vector<const T>`` (and similar containers of const 130 elements). These are not allowed in standard C++ due to undefined 131 ``std::allocator<const T>``. They do not compile with libstdc++ or MSVC. 132 Future libc++ will remove the extension (`D120996 133 <https://reviews.llvm.org/D120996>`). 134 135New check aliases 136^^^^^^^^^^^^^^^^^ 137 138- New alias :doc:`cppcoreguidelines-macro-to-enum 139 <clang-tidy/checks/cppcoreguidelines-macro-to-enum>` to :doc:`modernize-macro-to-enum 140 <clang-tidy/checks/modernize-macro-to-enum>` was added. 141 142Changes in existing checks 143^^^^^^^^^^^^^^^^^^^^^^^^^^ 144 145- Fixed nonsensical suggestion of :doc:`altera-struct-pack-align 146 <clang-tidy/checks/altera-struct-pack-align>` check for empty structs. 147 148- Fixed some false positives in :doc:`bugprone-infinite-loop 149 <clang-tidy/checks/bugprone-infinite-loop>` involving dependent expressions. 150 151- Fixed a crash in :doc:`bugprone-sizeof-expression 152 <clang-tidy/checks/bugprone-sizeof-expression>` when `sizeof(...)` is 153 compared against a `__int128_t`. 154 155- Improved :doc:`cppcoreguidelines-prefer-member-initializer 156 <clang-tidy/checks/cppcoreguidelines-prefer-member-initializer>` check. 157 158 Fixed an issue when there was already an initializer in the constructor and 159 the check would try to create another initializer for the same member. 160 161- Fixed a crash in :doc:`llvmlibc-callee-namespace 162 <clang-tidy/checks/llvmlibc-callee-namespace>` when executing for C++ code 163 that contain calls to advanced constructs, e.g. overloaded operators. 164 165- Fixed a false positive in :doc:`misc-redundant-expression 166 <clang-tidy/checks/misc-redundant-expression>` involving overloaded 167 comparison operators. 168 169- Fixed a false positive in :doc:`misc-redundant-expression 170 <clang-tidy/checks/misc-redundant-expression>` involving assignments in 171 conditions. This fixes `Issue 35853 <https://github.com/llvm/llvm-project/issues/35853>`_. 172 173- Improved :doc:`performance-inefficient-vector-operation 174 <clang-tidy/checks/performance-inefficient-vector-operation>` to work when 175 the vector is a member of a structure. 176 177- Fixed a crash in :doc:`readability-const-return-type 178 <clang-tidy/checks/readability-const-return-type>` when a pure virtual function 179 overrided has a const return type. Removed the fix for a virtual function. 180 181- Fixed incorrect suggestions for :doc:`readability-container-size-empty 182 <clang-tidy/checks/readability-container-size-empty>` when smart pointers are involved. 183 184- Fixed a false positive in :doc:`readability-non-const-parameter 185 <clang-tidy/checks/readability-non-const-parameter>` when the parameter is 186 referenced by an lvalue. 187 188Removed checks 189^^^^^^^^^^^^^^ 190 191Improvements to include-fixer 192----------------------------- 193 194The improvements are... 195 196Improvements to clang-include-fixer 197----------------------------------- 198 199The improvements are... 200 201Improvements to modularize 202-------------------------- 203 204The improvements are... 205 206Improvements to pp-trace 207------------------------ 208 209The improvements are... 210 211Clang-tidy Visual Studio plugin 212------------------------------- 213