Extra Clang Tools 21.0.0git (In-Progress) Release Notes

Written by the LLVM Team

Warning

These are in-progress notes for the upcoming Extra Clang Tools 21 release. Release notes for previous releases can be found on the Download Page.

Introduction

This document contains the release notes for the Extra Clang Tools, part of the Clang release 21.0.0git. 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.

For more information about Clang or LLVM, including information about the latest release, please see the Clang Web Site or the LLVM Web Site.

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.

What’s New in Extra Clang Tools 21.0.0git?

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

Diagnostics

Semantic Highlighting

Compile flags

  • Added BuiltinHeaders config key which controls whether clangd’s built-in headers are used or ones extracted from the driver.

Hover

Code completion

Code actions

Signature help

Cross-references

Objective-C

Miscellaneous

Improvements to clang-doc

Improvements to clang-query

Improvements to clang-tidy

  • clang-tidy no longer processes declarations from system headers by default, greatly improving performance. This behavior is disabled if the SystemHeaders option is enabled. Note: this may lead to false negatives; downstream users may need to adjust their checks to preserve existing behavior.

  • Improved clang-tidy-diff.py script. Add the -warnings-as-errors argument to treat warnings as errors.

New checks

New check aliases

Changes in existing checks

  • Improved bugprone-optional-value-conversion check to detect conversion in argument of std::make_optional.

  • Improved bugprone-string-constructor check to find suspicious calls of std::string constructor with char pointer, start position and length parameters.

  • Improved bugprone-unchecked-optional-access fixing false positives from smart pointer accessors repeated in checking has_value and accessing value. The option IgnoreSmartPointerDereference should no longer be needed and will be removed. Also fixing false positive from const reference accessors to objects containing optional member.

  • Improved bugprone-unsafe-functions check to allow specifying additional C++ member functions to match.

  • Improved misc-const-correctness check by adding the option AllowedTypes, that excludes specified types from const-correctness checking and fixing false positives when modifying variant by operator[] with template in parameters and supporting to check pointee mutation by AnalyzePointers option.

  • Improved misc-redundant-expression check by providing additional examples and fixing some macro related false positives.

  • Improved misc-unused-using-decls check by fixing false positives on operator"" with template parameters.

  • Improved misc-use-internal-linkage check by fix false positives for function or variable in header file which contains macro expansion.

  • Improved modernize-use-default-member-init check by matching constexpr and static` values on member initialization and by detecting explicit casting of built-in types within member list initialization.

  • Improved modernize-use-ranges check by updating suppress warnings logic for nullptr in std::find.

  • Improved modernize-use-starts-ends-with check by adding more matched scenarios of find and rfind methods and fixing false positives when those methods were called with 3 arguments.

  • Improved modernize-use-std-numbers check to support math functions of different precisions.

  • Improved performance-move-const-arg check by fixing false negatives on ternary operators calling std::move.

  • Improved performance-unnecessary-value-param check performance by tolerating fix-it breaking compilation when functions is used as pointers to avoid matching usage of functions within the current compilation unit.

Removed checks

Miscellaneous

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

Clang-tidy Visual Studio plugin