# Extra Clang Tools 6 documentation

## Extra Clang Tools 6.0.0 Release Notes

- Introduction
- What’s New in Extra Clang Tools 6.0.0?
  - Improvements to clang-tidy

Written by the LLVM Team

## Introduction

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

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.

### Improvements to clang-tidy

- New module fuchsia for Fuchsia style checks.

- New module objc for Objective-C style checks.

- New android-cloexec-accept check

  Detects usage of `accept()`.

- New android-cloexec-accept4 check

  Checks if the required file flag `SOCK_CLOEXEC` is present in the argument of `accept4()`.

- New android-cloexec-dup check

  Detects usage of `dup()`.

- New android-cloexec-epoll-create check

  Detects usage of `epoll_create()`.

- New android-cloexec-epoll-create1 check

  Checks if the required file flag `EPOLL_CLOEXEC` is present in the argument of `epoll_create1()`.

- New android-cloexec-inotify-init check

  Detects usage of `inotify_init()`.

- New android-cloexec-inotify-init1 check

  Checks if the required file flag `IN_CLOEXEC` is present in the argument of `inotify_init1()`.

- New android-cloexec-memfd_create check

  Checks if the required file flag `MFD_CLOEXEC` is present in the argument of `memfd_create()`.

- New bugprone-copy-constructor-init check

  Finds copy constructors which don’t call the copy constructor of the base class.

- New bugprone-integer-division check

  Finds cases where integer division in a floating point context is likely to cause unintended loss of precision.

- New bugprone-misplaced-operator-in-strlen-in-alloc check

  Finds cases where `1` is added to the string in the argument to `strlen()`, `strnlen()`, `strnlen_s()`, `wcslen()`, `wcsnlen()`, and `wcsnlen_s()` instead of the result and the value is used as an argument to a memory allocation function (`malloc()`, `calloc()`, `realloc()`, `alloca()`) or the `new[]` operator in C++.

- New cppcoreguidelines-owning-memory check

  This check implements the type-based semantic of `gsl::owner<T*>`, but without flow analysis.

- New fuchsia-default-arguments check

  Warns if a function or method is declared or called with default arguments.

- New fuchsia-overloaded-operator check

  Warns if an operator is overloaded, except for the assignment (copy and move) operators.

- New fuchsia-virtual-inheritance check

  Warns if classes are defined with virtual inheritance.

- New google-objc-avoid-throwing-exception check

  Finds uses of throwing exceptions usages in Objective-C files.

- New google-objc-global-variable-declaration check

  Finds global variable declarations in Objective-C files that do not follow the pattern of variable names in Google’s Objective-C Style Guide.

- New hicpp-exception-baseclass check

  Ensures that all exception will be instances of `std::exception` and classes that are derived from it.

- New hicpp-signed-bitwise check

  Finds uses of bitwise operations on signed integer types, which may lead to undefined or implementation defined behaviour.

- New objc-avoid-nserror-init check

  Finds improper initialization of `NSError` objects.

- New objc-avoid-spinlock check

  Finds usages of `OSSpinlock`, which is deprecated due to potential livelock problems.

- New objc-forbidden-subclassing check

  Finds Objective-C classes which are subclasses of classes which are not designed to be subclassed.

- New objc-property-declaration check

  Finds property declarations in Objective-C files that do not follow the pattern of property names in Apple’s programming guide.

- New readability-static-accessed-through-instance check

  Finds member expressions that access static members through instances and replaces them with uses of the appropriate qualified-id.

- The ‘misc-argument-comment’ check was renamed to bugprone-argument-comment

- The ‘misc-assert-side-effect’ check was renamed to bugprone-assert-side-effect

- The ‘misc-bool-pointer-implicit-conversion’ check was renamed to bugprone-bool-pointer-implicit-conversion

- The ‘misc-dangling-handle’ check was renamed to bugprone-dangling-handle

- The ‘misc-fold-init-type’ check was renamed to bugprone-fold-init-type

- The ‘misc-forward-declaration-namespace’ check was renamed to bugprone-forward-declaration-namespace

- The ‘misc-inaccurate-erase’ check was renamed to bugprone-inaccurate-erase

- The ‘misc-inefficient-algorithm’ check was renamed to performance-inefficient-algorithm

- The ‘misc-move-const-arg’ check was renamed to performance-move-const-arg

- The ‘misc-move-constructor-init’ check was renamed to performance-move-constructor-init

- The ‘misc-move-forwarding-reference’ check was renamed to bugprone-move-forwarding-reference

- The ‘misc-multiple-statement-macro’ check was renamed to bugprone-multiple-statement-macro

- The ‘misc-noexcept-move-constructor’ check was renamed to performance-noexcept-move-constructor

- The ‘misc-string-constructor’ check was renamed to bugprone-string-constructor

- The ‘misc-use-after-move’ check was renamed to bugprone-use-after-move

- The ‘performance-implicit-cast-in-loop’ check was renamed to performance-implicit-conversion-in-loop

- The ‘readability-implicit-bool-cast’ check was renamed to readability-implicit-bool-conversion

  > The check’s options were renamed as follows:

  > - AllowConditionalIntegerCasts -> AllowIntegerConditions,
  > - AllowConditionalPointerCasts -> AllowPointerConditions.

- Added modernize-use-emplace.IgnoreImplicitConstructors option.

- Added aliases for the High Integrity C++ Coding Standard to already implemented checks in other modules.

  - hicpp-deprecated-headers
  - hicpp-move-const-arg
  - hicpp-no-array-decay
  - hicpp-no-malloc
  - hicpp-static-assert
  - hicpp-use-auto
  - hicpp-use-emplace
  - hicpp-use-noexcept
  - hicpp-use-nullptr
  - hicpp-vararg

- Added the ability to suppress specific checks (or all checks) in a `NOLINT` or `NOLINTNEXTLINE` comment.

- Added new functionality to misc-redundant-expression check

  Finds redundant binary operator expressions where the operators are overloaded, and ones that contain the same macros twice. Also checks for assignment expressions that do not change the value of the assigned variable, and expressions that always evaluate to the same value because of possible operator confusion.