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

Written by the LLVM Team

Warning

These are in-progress notes for the upcoming Extra Clang Tools 23 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 23.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 23.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

Potentially Breaking Changes

Improvements to clangd

Inlay hints

Diagnostics

Semantic Highlighting

Compile flags

Hover

Code completion

  • Now also provides include files without extension, if they are in a directory only called include.

Code actions

Signature help

Cross-references

Objective-C

Miscellaneous

Improvements to clang-doc

Improvements to clang-query

Improvements to clang-tidy

  • Improved check_clang_tidy.py script by adding the -check-header argument to simplify testing of header files. This argument automatically manages the creation of temporary header files and ensures that diagnostics and fixes are verified for the specified headers.

New checks

  • New bugprone-unsafe-to-allow-exceptions check.

    Finds functions where throwing exceptions is unsafe but the function is still marked as potentially throwing.

  • New llvm-type-switch-case-types check.

    Finds llvm::TypeSwitch::Case calls with redundant explicit template arguments that can be inferred from the lambda parameter type.

  • New llvm-use-vector-utils check.

    Finds calls to llvm::to_vector(llvm::map_range(...)) and llvm::to_vector(llvm::make_filter_range(...)) that can be replaced with llvm::map_to_vector and llvm::filter_to_vector.

  • New modernize-use-string-view check.

    Looks for functions returning std::[w|u8|u16|u32]string and suggests to change it to std::[...]string_view for performance reasons if possible.

  • New modernize-use-structured-binding check.

    Finds places where structured bindings could be used to decompose pairs and suggests replacing them.

  • New performance-string-view-conversions check.

    Finds and removes redundant conversions from std::[w|u8|u16|u32]string_view to std::[...]string in call expressions expecting std::[...]string_view.

  • New performance-use-std-move check.

    Suggests insertion of std::move(...) to turn copy assignment operator calls into move assignment ones, when deemed valid and profitable.

  • New readability-trailing-comma check.

    Checks for presence or absence of trailing commas in enum definitions and initializer lists.

New check aliases

Changes in existing checks

  • Improved bugprone-argument-comment to also check for C++11 inherited constructors.

  • Improved bugprone-bad-signal-to-kill-thread check by fixing false negatives when the SIGTERM macro is obtained from a precompiled header.

  • Improved bugprone-casting-through-void check by running only on C++ files because suggested reinterpret_cast is not available in pure C.

  • Improved bugprone-exception-escape check by adding TreatFunctionsWithoutSpecificationAsThrowing option to support reporting for unannotated functions, enabling reporting when no explicit throw is seen and allowing separate tuning for known and unknown implementations.

  • Improved bugprone-fold-init-type check by detecting precision loss in overloads with transparent standard functors (e.g. std::plus<>) for std::accumulate, std::reduce, and std::inner_product.

  • Improved bugprone-macro-parentheses check by printing the macro definition in the warning message if the macro is defined on command line.

  • Improved bugprone-std-namespace-modification check by fixing false positives when extending the standard library with a specialization of user-defined type.

  • Improved bugprone-string-constructor check to detect suspicious string constructor calls when the string class constructor has a default allocator argument.

  • Improved bugprone-unsafe-functions check by adding the function std::get_temporary_buffer to the default list of unsafe functions. (This function is unsafe, useless, deprecated in C++17 and removed in C++20).

  • Improved bugprone-use-after-move check by including the name of the invalidating function in the warning message when a custom invalidation function is used (via the InvalidationFunctions option).

  • Improved cppcoreguidelines-init-variables check by ensuring that member pointers are correctly flagged as uninitialized.

  • Improved cppcoreguidelines-missing-std-forward check by fixing a false positive for constrained template parameters.

  • Improved cppcoreguidelines-pro-type-vararg check by no longer warning on builtins with custom type checking (e.g., type-generic builtins like __builtin_clzg) that use variadic declarations as an implementation detail.

  • Improved llvm-use-ranges check by adding support for the following algorithms: std::accumulate, std::replace_copy, and std::replace_copy_if.

  • Improved misc-const-correctness check:

    • Added support for analyzing function parameters with the AnalyzeParameters option.

    • Fixed false positive where an array of pointers to const was incorrectly diagnosed as allowing the pointee to be made const.

  • Improved misc-throw-by-value-catch-by-reference check:

    • Fixed the WarnOnLargeObject option to use the correct name when storing the configuration.

    • Fixed the CheckThrowTemporaries option to correctly reflect its configured value in exported settings.

  • Improved misc-unused-using-decls to not diagnose using declarations as unused if they’re exported from a module.

  • Improved modernize-pass-by-value check by adding IgnoreMacros option to suppress warnings in macros.

  • Improved modernize-redundant-void-arg check to work in C23.

  • Improved modernize-use-equals-delete check by only warning on private deleted functions, if they do not have a public overload or are a special member function.

  • Improved modernize-use-std-format check by fixing a crash when an argument is part of a macro expansion.

  • Improved modernize-use-using check by avoiding the generation of invalid code for function types with redundant parentheses.

  • Improved performance-enum-size check:

    • Exclude enum in extern "C" blocks.

    • Improved the ignore list to correctly handle typedef and enum.

  • Improved performance-faster-string-find check:

    • Now analyzes calls to the starts_with, ends_with, contains, and operator+= string member functions.

    • Fixes false negatives when using std::set from libstdc++.

  • Improved performance-inefficient-vector-operation check by correctly handling vector-like classes when push_back/emplace_back are inherited.

  • Improved performance-move-const-arg check by avoiding false positives on trivially copyable types with a non-public copy constructor.

  • Improved readability-container-size-empty check by fixing a crash when a member expression has a non-identifier name.

  • Improved readability-else-after-return check:

    • Fixed missed diagnostics when if statements appear in unbraced switch case labels.

    • Added support for handling attributed if then-branches such as [[likely]] and [[unlikely]].

  • Improved readability-enum-initial-value check: the warning message now uses separate note diagnostics for each uninitialized enumerator, making it easier to see which specific enumerators need explicit initialization.

  • Improved readability-non-const-parameter check by avoiding false positives on parameters used in dependent expressions (e.g. inside generic lambdas).

  • Improved readability-redundant-preprocessor check by fixing a false positive for nested #if directives using different builtin expressions such as __has_builtin and __has_cpp_attribute.

  • Improved readability-simplify-boolean-expr check to provide valid fix suggestions for C23 and later by not using static_cast.

  • Improved readability-simplify-subscript-expr check by fixing missing warnings when subscripting an object held inside a generic container (e.g. subscripting a std::string held inside a std::vector<std::string>).

  • Improved readability-suspicious-call-argument check by avoiding a crash from invalid Abbreviations option.

Removed checks

Miscellaneous

Improvements to include-fixer

Improvements to clang-include-fixer

Improvements to modularize

Improvements to pp-trace

Clang-tidy Visual Studio plugin