Extra Clang Tools 17.0.6 Release Notes

Written by the LLVM Team

Introduction

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

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

Hover

Code completion

Signature help

Cross-references

Objective-C

Miscellaneous

Improvements to clang-doc

Improvements to clang-query

The improvements are…

Improvements to clang-rename

The improvements are…

Improvements to clang-tidy

  • New global configuration file options HeaderFileExtensions and ImplementationFileExtensions, replacing the check-local options of the same name.

  • Support specifying Checks as a YAML list in the .clang-tidy configuration file.

  • Fix a potential crash when using the –dump-config option.

  • Support specifying SystemHeaders in the .clang-tidy configuration file, with the same functionality as the command-line option –system-headers.

  • WarningsAsErrors (–warnings-as-errors=) no longer promotes unlisted warnings to errors. Only the warnings listed in Checks (–checks=) will be promoted to errors. For custom error promotion, use -Werror=<warning> on the compiler command-line, irrespective of Checks (–checks=) settings.

  • Fixed an issue where compiler warnings couldn’t be suppressed using -Wno-<warning> under C++20 and above.

New checks

  • New bugprone-empty-catch check.

    Detects and suggests addressing issues with empty catch statements.

  • New bugprone-multiple-new-in-one-expression check.

    Finds multiple new operator calls in a single expression, where the allocated memory by the first new may leak if the second allocation fails and throws exception.

  • New bugprone-non-zero-enum-to-bool-conversion check.

    Detect implicit and explicit casts of enum type into bool where enum type doesn’t have a zero-value enumerator.

  • New bugprone-switch-missing-default-case check.

    Ensures that switch statements without default cases are flagged, focuses only on covering cases with non-enums where the compiler may not issue warnings.

  • New bugprone-unique-ptr-array-mismatch check.

    Finds initializations of C++ unique pointers to non-array type that are initialized with an array.

  • New bugprone-unsafe-functions check.

    Checks for functions that have safer, more secure replacements available, or are considered deprecated due to design flaws. This check relies heavily on, but is not exclusive to, the functions from the Annex K. “Bounds-checking interfaces” of C11.

  • New cppcoreguidelines-avoid-capturing-lambda-coroutines check.

    Flags C++20 coroutine lambdas with non-empty capture lists that may cause use-after-free errors and suggests avoiding captures or ensuring the lambda closure object has a guaranteed lifetime.

  • New cppcoreguidelines-misleading-capture-default-by-value check.

    Warns when lambda specify a by-value capture default and capture this.

  • New cppcoreguidelines-missing-std-forward check.

    Warns when a forwarding reference parameter is not forwarded within the function body.

  • New cppcoreguidelines-rvalue-reference-param-not-moved check.

    Warns when an rvalue reference function parameter is never moved within the function body.

  • New llvmlibc-inline-function-decl check.

    Checks that all implicit and explicit inline functions in header files are tagged with the LIBC_INLINE macro.

  • New misc-header-include-cycle check.

    Check detects cyclic #include dependencies between user-defined headers.

  • New misc-include-cleaner check.

    Checks for unused and missing includes.

  • New modernize-type-traits check.

    Converts standard library type traits of the form traits<...>::type and traits<...>::value into traits_t<...> and traits_v<...> respectively.

  • New modernize-use-std-print check.

    Converts calls to printf, fprintf, absl::PrintF, absl::FPrintf or other functions via configuration options, to equivalent calls to C++23’s std::print and std::println, or other functions via a configuration option, modifying the format string appropriately and removing now-unnecessary calls to std::string::c_str() and std::string::data().

  • New performance-avoid-endl check.

    Finds uses of std::endl on streams and replaces them with '\n'.

  • New performance-noexcept-destructor check.

    Finds user declared destructors which are not noexcept.

  • New performance-noexcept-swap check.

    Finds user declared swap functions which are not noexcept.

  • New readability-avoid-unconditional-preprocessor-if check.

    Finds code blocks that are constantly enabled or disabled in preprocessor directives by analyzing #if conditions, such as #if 0 and #if 1, etc.

  • New readability-operators-representation check.

    Enforces consistent token representation for invoked binary, unary and overloaded operators in C++ code.

New check aliases

Changes in existing checks

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

Clang-tidy Visual Studio plugin