Extra Clang Tools 5.0.0 Release Notes¶
Written by the LLVM Team
Introduction¶
This document contains the release notes for the Extra Clang Tools, part of the Clang release 5.0.0. 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.
What’s New in Extra Clang Tools 5.0.0?¶
Improvements to clang-tidy¶
New android-cloexec-creat check
Detect usage of
creat().New android-cloexec-open check
Checks if the required file flag
O_CLOEXECexists inopen(),open64()andopenat().New android-cloexec-fopen check
Checks if the required mode
eexists in the mode argument offopen().New android-cloexec-socket check
Checks if the required file flag
SOCK_CLOEXECis present in the argument ofsocket().New bugprone-suspicious-memset-usage check
Finds
memset()calls with potential mistakes in their arguments. Replaces and extends thegoogle-runtime-memsetcheck.New bugprone-undefined-memory-manipulation check
Finds calls of memory manipulation functions
memset(),memcpy()andmemmove()on not TriviallyCopyable objects resulting in undefined behavior.New cert-dcl21-cpp check
Checks if the overloaded postfix
operator++/--returns a constant object.New cert-dcl58-cpp check
Finds modification of the
stdorposixnamespace.Improved cppcoreguidelines-no-malloc check
Allow custom memory management functions to be considered as well.
New misc-forwarding-reference-overload check
Finds perfect forwarding constructors that can unintentionally hide copy or move constructors.
New misc-lambda-function-name check
Finds uses of
__func__or__FUNCTION__inside lambdas.New modernize-replace-random-shuffle check
Finds and fixes usage of
std::random_shuffleas the function has been removed from C++17.New modernize-return-braced-init-list check
Finds and replaces explicit calls to the constructor in a return statement by a braced initializer list so that the return type is not needlessly repeated.
New modernize-unary-static-assert-check check
The check diagnoses any
static_assertdeclaration with an empty string literal and provides a fix-it to replace the declaration with a single-argumentstatic_assertdeclaration.Improved modernize-use-emplace check
Removes unnecessary
std::make_pairandstd::make_tuplecalls in push_back calls and turns them into emplace_back. The check now also is able to remove user-defined make functions frompush_backcalls on containers of custom tuple-like types by providing TupleTypes and TupleMakeFunctions.New modernize-use-noexcept check
Replaces dynamic exception specifications with
noexceptor a user defined macro.New performance-inefficient-vector-operation check
Finds possible inefficient vector operations in for loops that may cause unnecessary memory reallocations.
Added NestingThreshold to readability-function-size check
Finds compound statements which create next nesting level after NestingThreshold and emits a warning.
Added ParameterThreshold to readability-function-size check
Finds functions that have more than ParameterThreshold parameters and emits a warning.
New readability-misleading-indentation check
Finds misleading indentation where braces should be introduced or the code should be reformatted.
Support clang-formatting of the code around applied fixes (
-format-stylecommand-line option).New bugprone module
Adds checks that target bugprone code constructs.
New hicpp module
Adds checks that implement the High Integrity C++ Coding Standard and other safety standards. Many checks are aliased to other modules.