diff --git a/clang-tools-extra/docs/clang-tidy/Contributing.rst b/clang-tools-extra/docs/clang-tidy/Contributing.rst --- a/clang-tools-extra/docs/clang-tidy/Contributing.rst +++ b/clang-tools-extra/docs/clang-tidy/Contributing.rst @@ -131,8 +131,8 @@ `_ and contain checks targeting a certain aspect of code quality (performance, readability, etc.), certain coding style or standard (Google, LLVM, CERT, etc.) -or a widely used API (e.g. MPI). Their names are same as user-facing check -groups names described :ref:`above `. +or a widely used API (e.g. MPI). Their names are the same as the user-facing +check group names described :ref:`above `. After choosing the module and the name for the check, run the ``clang-tidy/add_new_check.py`` script to create the skeleton of the check and @@ -441,8 +441,8 @@ * To restrict the files examined you can provide one or more regex arguments that the file names are matched against. ``run-clang-tidy.py clang-tidy/.*Check\.cpp`` will only analyze clang-tidy - checks. It may also be necessary to restrict the header files warnings are - displayed from using the ``-header-filter`` flag. It has the same behavior + checks. It may also be necessary to restrict the header files that warnings + are displayed from using the ``-header-filter`` flag. It has the same behavior as the corresponding :program:`clang-tidy` flag. * To apply suggested fixes ``-fix`` can be passed as an argument. This gathers @@ -475,7 +475,7 @@ .. code-block:: console - $ clang-tidy -enable-check-profile -store-check-profile=. -checks=-*,readability-function-size source.cpp + $ clang-tidy -enable-check-profile -store-check-profile=. -checks=-*,readability-function-size source.cpp $ # Note that there won't be timings table printed to the console. $ ls /tmp/out/ 20180516161318717446360-source.cpp.json diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst --- a/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil-duration-conversion-cast.rst @@ -27,5 +27,5 @@ Note: In the second example, the suggested fix could yield a different result, -as the conversion to integer could truncate. In practice, this is very rare, +as the conversion to integer could truncate. In practice, this is very rare, and you should use ``absl::Trunc`` to perform this operation explicitly instead. diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst --- a/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst @@ -5,7 +5,7 @@ Warns if code using Abseil depends on internal details. If something is in a namespace that includes the word "internal", code is not allowed to depend upon -it because it’s an implementation detail. They cannot friend it, include it, +it because it's an implementation detail. They cannot friend it, include it, you mention it or refer to it in any way. Doing so violates Abseil's compatibility guidelines and may result in breakage. See https://abseil.io/about/compatibility for more information. diff --git a/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst b/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst --- a/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/abseil-string-find-str-contains.rst @@ -10,7 +10,7 @@ ``find()`` and ``npos`` from different string-like types. By default, "string-like types" includes ``::std::basic_string``, -``::std::basic_string_view``, and ``::absl::string_view``. See the +``::std::basic_string_view``, and ``::absl::string_view``. See the StringLikeClasses option to change this. .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst --- a/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-open.rst @@ -4,7 +4,7 @@ ==================== A common source of security bugs is code that opens a file without using the -``O_CLOEXEC`` flag. Without that flag, an opened sensitive file would remain +``O_CLOEXEC`` flag. Without that flag, an opened sensitive file would remain open across a fork+exec to a lower-privileged SELinux domain, leaking that sensitive data. Open-like functions including ``open()``, ``openat()``, and ``open64()`` should include ``O_CLOEXEC`` in their flags argument. diff --git a/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst --- a/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/android-cloexec-pipe2.rst @@ -3,7 +3,7 @@ android-cloexec-pipe2 ===================== -This checks ensures that pipe2() is called with the O_CLOEXEC flag. The check also +This check ensures that pipe2() is called with the O_CLOEXEC flag. The check also adds the O_CLOEXEC flag that marks the file descriptor to be closed in child processes. Without this flag a sensitive file descriptor can be leaked to a child process, potentially into a lower-privileged SELinux domain. diff --git a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst --- a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst @@ -8,7 +8,7 @@ ``std::to_string`` and ``std::to_wstring``. It doesn't replace conversion from floating points despite the ``to_string`` -overloads, because it would change the behaviour. +overloads, because it would change the behavior. .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-branch-clone.rst @@ -87,4 +87,4 @@ operators. Note: This check also reports situations where branches become identical only -after preprocession. +after preprocessing. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-easily-swappable-parameters.rst @@ -116,7 +116,7 @@ The value is a `;`-separated list of names. To ignore unnamed parameters, add `""` to the list verbatim (not the empty string, but the two quotes, potentially escaped!). - **This options is case-sensitive!** + **This option is case-sensitive!** By default, the following parameter names, and their Uppercase-initial variants are ignored: @@ -154,7 +154,7 @@ ``a < b``. * The parameters are further passed to the same function to the same parameter of that function, of the same overload. - E.g. ``f(a, 1)`` and ``f(b, 2)`` to some ``f(T, int)``. + e.g. ``f(a, 1)`` and ``f(b, 2)`` to some ``f(T, int)``. .. note:: @@ -202,7 +202,7 @@ Most of these cases, which are otherwise swappable from a caller's standpoint, have no way of getting "fixed" at the definition point. In the case of C++ templates, only primary template definitions and explicit -specialisations are matched and analysed. +specializations are matched and analyzed. None of the following cases produce a diagnostic: @@ -241,7 +241,7 @@ void exact(typename Vector::element_type A, typename Vector::element_type B) { /* ... */ } - // Skipped: The two parameters are both 'T' but we can not prove this + // Skipped: The two parameters are both 'T' but we cannot prove this // without actually instantiating. template void falseNegative(T A, typename Vector::element_type B) { /* ... */ } diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.rst @@ -8,7 +8,7 @@ widening explicit, or to perform the multiplication in a wider type, to avoid the widening afterwards. -This is mainly useful when operating on a very large buffers. +This is mainly useful when operating on very large buffers. For example, consider: .. code-block:: c++ @@ -22,7 +22,7 @@ } } -This is fine in general, but iff ``width * height`` overflows, +This is fine in general, but if ``width * height`` overflows, you end up wrapping back to the beginning of ``base`` instead of processing the entire requested buffer. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-macro-parentheses.rst @@ -4,10 +4,10 @@ ========================== -Finds macros that can have unexpected behaviour due to missing parentheses. +Finds macros that can have unexpected behavior due to missing parentheses. Macros are expanded by the preprocessor as-is. As a result, there can be -unexpected behaviour; operators may be evaluated in unexpected order and +unexpected behavior; operators may be evaluated in unexpected order and unary operators may become binary operators, etc. When the replacement list has an expression, it is recommended to surround diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-operator-in-strlen-in-alloc.rst @@ -9,7 +9,7 @@ allocation function (``malloc()``, ``calloc()``, ``realloc()``, ``alloca()``) or the ``new[]`` operator in `C++`. The check detects error cases even if one of these functions (except the ``new[]`` operator) is called by a constant function -pointer. Cases where ``1`` is added both to the parameter and the result of the +pointer. Cases where ``1`` is added both to the parameter and the result of the ``strlen()``-like function are ignored, as are cases where the whole addition is surrounded by extra parentheses. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-not-null-terminated-result.rst @@ -6,7 +6,7 @@ Finds function calls where it is possible to cause a not null-terminated result. Usually the proper length of a string is ``strlen(src) + 1`` or equal length of this expression, because the null terminator needs an extra space. Without the -null terminator it can result in undefined behaviour when the string is read. +null terminator it can result in undefined behavior when the string is read. The following and their respective ``wchar_t`` based functions are checked: @@ -61,7 +61,7 @@ obtain the capacity of the destination array then the new function could be the safe version (ending with ``cpy_s``). -- If the new function is could be safe version and C++ files are analysed and +- If the new function is could be safe version and C++ files are analyzed and the destination array is plain ``char``/``wchar_t`` without ``un/signed`` then the length of the destination array can be omitted. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-sizeof-expression.rst @@ -185,5 +185,5 @@ .. option:: WarnOnSizeOfCompareToConstant When `true`, the check will warn on an expression like - ``sizeof(epxr) <= k`` for a suspicious constant `k` while `k` is `0` or + ``sizeof(expr) <= k`` for a suspicious constant `k` while `k` is `0` or greater than `0x8000`. Default is `true`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-string-compare.rst @@ -14,7 +14,7 @@ if (!strcmp(...)) // Won't warn if (strcmp(...) != 0) // Won't warn -Checks that compare function results (i,e, ``strcmp``) are compared to valid +Checks that compare function results (i.e., ``strcmp``) are compared to valid constant. The resulting value is .. code:: diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst @@ -25,7 +25,7 @@ for (short i = 0; i < items.size(); ++i) {} } -This algorithm works for small amount of objects, but will lead to freeze for a +This algorithm works for a small amount of objects, but will lead to freeze for a larger user input. .. option:: MagnitudeBitsUpperLimit diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst @@ -21,5 +21,5 @@ types ``std::bad_alloc``, ``std::exception``, and catch-all handler). The check assumes that any user-defined ``operator new`` is either ``noexcept`` or may throw an exception of type ``std::bad_alloc`` (or derived -from it). Other exception types or exceptions occurring in the objects's +from it). Other exception types or exceptions occurring in the object's constructor are not taken into account. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-virtual-near-miss.rst @@ -3,7 +3,7 @@ bugprone-virtual-near-miss ========================== -Warn if a function is a near miss (ie. the name is very similar and the function +Warn if a function is a near miss (i.e. the name is very similar and the function signature is the same) to a virtual function from a base class. Example: diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst --- a/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-dcl21-cpp.rst @@ -21,4 +21,4 @@ DCL21-CPP. Overloaded postfix increment and decrement operators should return a const object. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior of this check requires -an account on their wiki to view. \ No newline at end of file +an account on their wiki to view. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst --- a/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-err09-cpp.rst @@ -12,4 +12,4 @@ This check corresponds to the CERT C++ Coding Standard recommendation ERR09-CPP. Throw anonymous temporaries. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior -of this check requires an account on their wiki to view. \ No newline at end of file +of this check requires an account on their wiki to view. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst b/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst --- a/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cert-oop11-cpp.rst @@ -13,4 +13,4 @@ OOP11-CPP. Do not copy-initialize members or base classes from a move constructor. However, all of the CERT recommendations have been removed from public view, and so their justification for the behavior of this check requires -an account on their wiki to view. \ No newline at end of file +an account on their wiki to view. diff --git a/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst b/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst --- a/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/concurrency-mt-unsafe.rst @@ -12,7 +12,7 @@ concurrent programming if only a single thread is used (e.g. setenv(3)), however, some functions may track a state in global variables which would be clobbered by subsequent (non-parallel, but concurrent) calls to -a related function. E.g. the following code suffers from unprotected +a related function. e.g. the following code suffers from unprotected accesses to a global state: .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-init-variables.rst @@ -4,7 +4,7 @@ ================================ Checks whether there are local variables that are declared without an initial -value. These may lead to unexpected behaviour if there is a code path that reads +value. These may lead to unexpected behavior if there is a code path that reads the variable before assigning to it. Only integers, booleans, floats, doubles and pointers are checked. The fix diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst @@ -84,7 +84,7 @@ You may have encountered messages like "narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined". -The C/C++ standard does not mandate two’s complement for signed integers, and so +The C/C++ standard does not mandate two's complement for signed integers, and so the compiler is free to define what the semantics are for converting an unsigned -integer to signed integer. Clang's implementation uses the two’s complement +integer to signed integer. Clang's implementation uses the two's complement format. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-special-member-functions.rst @@ -51,7 +51,7 @@ .. option:: AllowMissingMoveFunctionsWhenCopyIsDeleted When set to `true` (default is `false`), this check doesn't flag classes which define deleted copy - operations but don't define move operations. This flags is related to Google C++ Style Guide + operations but don't define move operations. This flag is related to Google C++ Style Guide https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types. With this option enabled, the following class won't be flagged: diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-virtual-class-destructor.rst @@ -5,7 +5,7 @@ Finds virtual classes whose destructor is neither public and virtual nor protected and non-virtual. A virtual class's destructor should be specified -in one of these ways to prevent undefined behaviour. +in one of these ways to prevent undefined behavior. This check implements `C.35 `_ diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst --- a/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp-multiway-paths-covered.rst @@ -68,7 +68,7 @@ int i = 42; switch(i) { case 1: // do something here - default: // do somethe else here + default: // do something else here } // Should rather be the following: diff --git a/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst b/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst --- a/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/hicpp-signed-bitwise.rst @@ -4,7 +4,7 @@ ==================== Finds uses of bitwise operations on signed integer types, which may lead to -undefined or implementation defined behaviour. +undefined or implementation defined behavior. The according rule is defined in the `High Integrity C++ Standard, Section 5.6.1 `_. diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst --- a/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-static-assert.rst @@ -5,7 +5,7 @@ `cert-dcl03-c` redirects here as an alias for this check. -Replaces ``assert()`` with ``static_assert()`` if the condition is evaluatable +Replaces ``assert()`` with ``static_assert()`` if the condition is evaluable at compile time. The condition of ``static_assert()`` is evaluated at compile time which is diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst --- a/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-throw-by-value-catch-by-reference.rst @@ -14,7 +14,8 @@ Exceptions: * Throwing string literals will not be flagged despite being a pointer. They - are not susceptible to slicing and the usage of string literals is idomatic. + are not susceptible to slicing and the usage of string literals is + idiomatic. * Catching character pointers (``char``, ``wchar_t``, unicode character types) will not be flagged to allow catching sting literals. * Moved named values will not be flagged as not throwing an anonymous @@ -22,7 +23,7 @@ can't be accessed outside catch blocks handling the error. * Throwing function parameters will not be flagged as not throwing an anonymous temporary. This allows helper functions for throwing. - * Re-throwing caught exception variables will not be flragged as not throwing + * Re-throwing caught exception variables will not be flagged as not throwing an anonymous temporary. Although this can usually be done by just writing ``throw;`` it happens often enough in real code. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-bind.rst @@ -72,7 +72,7 @@ return ignore_args(3, 3); } -which will *not* compile, since the lambda does not contain an ``operator()`` that +which will *not* compile, since the lambda does not contain an ``operator()`` that accepts 2 arguments. With permissive parameter list, it instead generates .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-avoid-c-arrays.rst @@ -56,5 +56,5 @@ } Similarly, the ``main()`` function is ignored. Its second and third parameters -can be either ``char* argv[]`` or ``char** argv``, but can not be +can be either ``char* argv[]`` or ``char** argv``, but cannot be ``std::array<>``. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst @@ -138,7 +138,7 @@ Specify the function used to reverse an iterator pair, the function should accept a class with ``rbegin`` and ``rend`` methods and return a - class with ``begin`` and ``end`` methods methods that call the ``rbegin`` and + class with ``begin`` and ``end`` methods that call the ``rbegin`` and ``rend`` methods respectively. Common examples are ``ranges::reverse_view`` and ``llvm::reverse``. Default value is an empty string. @@ -165,7 +165,7 @@ There are certain situations where the tool may erroneously perform transformations that remove information and change semantics. Users of the tool -should be aware of the behaviour and limitations of the check outlined by +should be aware of the behavior and limitations of the check outlined by the cases below. Comments inside loop headers @@ -300,7 +300,7 @@ ^^^^^^ As range-based for loops are only available since OpenMP 5, this check should -not been used on code with a compatibility requirements of OpenMP prior to +not be used on code with a compatibility requirement of OpenMP prior to version 5. It is **intentional** that this check does not make any attempts to exclude incorrect diagnostics on OpenMP for loops prior to OpenMP 5. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst @@ -124,7 +124,7 @@ contexts; templated constructors, constructors in class templates, constructors of inner classes of template classes, etc., are not transformed. Delayed template parsing is enabled by default on Windows as a Microsoft extension: -`Clang Compiler User’s Manual - Microsoft extensions`_. +`Clang Compiler User's Manual - Microsoft extensions`_. Delayed template parsing can be enabled using the `-fdelayed-template-parsing` flag and disabled using `-fno-delayed-template-parsing`. @@ -144,7 +144,7 @@ + C(std::string S) : S(std::move(S)) {} }; -.. _Clang Compiler User’s Manual - Microsoft extensions: https://clang.llvm.org/docs/UsersManual.html#microsoft-extensions +.. _Clang Compiler User's Manual - Microsoft extensions: https://clang.llvm.org/docs/UsersManual.html#microsoft-extensions .. seealso:: diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-disallow-copy-and-assign-macro.rst @@ -7,7 +7,7 @@ with a deleted copy constructor and a deleted assignment operator. Before the ``delete`` keyword was introduced in C++11 it was common practice to -declare a copy constructor and an assignment operator as a private members. This +declare a copy constructor and an assignment operator as private members. This effectively makes them unusable to the public API of a class. With the advent of the ``delete`` keyword in C++11 we can abandon the diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst @@ -57,7 +57,7 @@ The check will only replace iterator type-specifiers when all of the following conditions are satisfied: -* The iterator is for one of the standard container in ``std`` namespace: +* The iterator is for one of the standard containers in ``std`` namespace: * ``array`` * ``deque`` @@ -115,7 +115,7 @@ Frequently, when a pointer is declared and initialized with ``new``, the pointee type is written twice: in the declaration type and in the -``new`` expression. In this cases, the declaration type can be replaced with +``new`` expression. In this case, the declaration type can be replaced with ``auto`` improving readability and maintainability. .. code-block:: c++ @@ -148,7 +148,7 @@ Frequently, when a variable is declared and initialized with a cast, the variable type is written twice: in the declaration type and in the -cast expression. In this cases, the declaration type can be replaced with +cast expression. In this case, the declaration type can be replaced with ``auto`` improving readability and maintainability. .. code-block:: c++ @@ -162,7 +162,7 @@ The check handles ``static_cast``, ``dynamic_cast``, ``const_cast``, ``reinterpret_cast``, functional casts, C-style casts and function templates that behave as casts, such as ``llvm::dyn_cast``, ``boost::lexical_cast`` and -``gsl::narrow_cast``. Calls to function templates are considered to behave as +``gsl::narrow_cast``. Calls to function templates are considered to behave as casts if the first template argument is explicit and is a type, and the function returns that type, or a pointer or reference to it. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-default-member-init.rst @@ -36,7 +36,7 @@ .. option:: UseAssignment - If this option is set to `true` (default is `false`), the check will initialise + If this option is set to `true` (default is `false`), the check will initialize members with an assignment. For example: .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-noexcept.rst @@ -4,7 +4,7 @@ ====================== This check replaces deprecated dynamic exception specifications with -the appropriate noexcept specification (introduced in C++11). By +the appropriate noexcept specification (introduced in C++11). By default this check will replace ``throw()`` with ``noexcept``, and ``throw([,...])`` or ``throw(...)`` with ``noexcept(false)``. @@ -30,9 +30,9 @@ .. option:: ReplacementString Users can use :option:`ReplacementString` to specify a macro to use - instead of ``noexcept``. This is useful when maintaining source code + instead of ``noexcept``. This is useful when maintaining source code that uses custom exception specification marking other than - ``noexcept``. Fix-it hints will only be generated for non-throwing + ``noexcept``. Fix-it hints will only be generated for non-throwing specifications. Example diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst @@ -3,7 +3,7 @@ modernize-use-nullptr ===================== -The check converts the usage of null pointer constants (eg. ``NULL``, ``0``) +The check converts the usage of null pointer constants (e.g. ``NULL``, ``0``) to use the new C++11 ``nullptr`` keyword. Example diff --git a/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst b/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst --- a/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/objc-nsinvocation-argument-lifetime.rst @@ -7,7 +7,7 @@ argument object lifetimes. When passing Objective-C objects as parameters to the ``NSInvocation`` methods ``getArgument:atIndex:`` and ``getReturnValue:``, the values are copied by value into the argument pointer, -which leads to to incorrect releasing behavior if the object pointers are +which leads to incorrect releasing behavior if the object pointers are not declared ``__unsafe_unretained``. For code: diff --git a/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst b/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst --- a/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/openmp-exception-escape.rst @@ -8,9 +8,9 @@ As per the OpenMP specification, a structured block is an executable statement, possibly compound, with a single entry at the top and a single exit at the -bottom. Which means, ``throw`` may not be used to to 'exit' out of the +bottom. Which means, ``throw`` may not be used to 'exit' out of the structured block. If an exception is not caught in the same structured block -it was thrown in, the behaviour is undefined. +it was thrown in, the behavior is undefined. FIXME: this check does not model SEH, ``setjmp``/``longjmp``. diff --git a/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst b/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst --- a/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/openmp-use-default-none.rst @@ -18,7 +18,7 @@ .. code-block:: c++ - // ``for`` directive can not have ``default`` clause, no diagnostics. + // ``for`` directive cannot have ``default`` clause, no diagnostics. void n0(const int a) { #pragma omp for for (int b = 0; b < a; b++) diff --git a/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst b/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst --- a/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-algorithm.rst @@ -6,7 +6,7 @@ Warns on inefficient use of STL algorithms on associative containers. -Associative containers implements some of the algorithms as methods which +Associative containers implement some of the algorithms as methods which should be preferred to the algorithms in the algorithm header. The methods can take advantage of the order of the elements. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-const-return-type.rst @@ -5,7 +5,7 @@ Checks for functions with a ``const``-qualified return type and recommends removal of the ``const`` keyword. Such use of `const` is usually superfluous, -and can prevent valuable compiler optimizations. Does not (yet) fix trailing +and can prevent valuable compiler optimizations. Does not (yet) fix trailing return types. Examples: diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-data-pointer.rst @@ -4,8 +4,8 @@ ======================== Finds cases where code could use ``data()`` rather than the address of the -element at index 0 in a container. This pattern is commonly used to materialize -a pointer to the backing data of a container. ``std::vector`` and +element at index 0 in a container. This pattern is commonly used to materialize +a pointer to the backing data of a container. ``std::vector`` and ``std::string`` provide a ``data()`` accessor to retrieve the data pointer which should be preferred. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-else-after-return.rst @@ -74,7 +74,7 @@ When `true`, the check will attempt to refactor a variable defined inside the condition of the ``if`` statement that is used in the ``else`` branch defining them just before the ``if`` statement. This can only be done if - the ``if`` statement is the last statement in its parents scope. + the ``if`` statement is the last statement in its parent's scope. Default value is `true`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst @@ -67,8 +67,8 @@ Nesting level ^^^^^^^^^^^^^ -While by itself the nesting level not change the function's Cognitive Complexity -metric, it is tracked, and is used by the next, third building block. +While by itself the nesting level does not change the function's Cognitive +Complexity metric, it is tracked, and is used by the next, third building block. The following structures increase the nesting level (by `1`): * Conditional operators: diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-length.rst @@ -109,7 +109,7 @@ .. option:: IgnoredExceptionVariableNames Specifies a regular expression for exception variable names that are to - be ignored. The default value is `^[e]$` mainly for historical reasons. + be ignored. The default value is `^[e]$` mainly for historical reasons. .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-identifier-naming.rst @@ -33,7 +33,7 @@ Options ------- -The following options are describe below: +The following options are described below: - :option:`AbstractClassCase`, :option:`AbstractClassPrefix`, :option:`AbstractClassSuffix`, :option:`AbstractClassIgnoredRegexp`, :option:`AbstractClassHungarianPrefix` - :option:`AggressiveDependentMemberLookup` diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-magic-numbers.rst @@ -9,7 +9,7 @@ Many coding guidelines advise replacing the magic values with symbolic constants to improve readability. Here are a few references: - * `Rule ES.45: Avoid “magic constants”; use symbolic constants in C++ Core Guidelines `_ + * `Rule ES.45: Avoid "magic constants"; use symbolic constants in C++ Core Guidelines `_ * `Rule 5.1.1 Use symbolic names instead of literal values in code in High Integrity C++ `_ * Item 17 in "C++ Coding Standards: 101 Rules, Guidelines and Best Practices" by Herb Sutter and Andrei Alexandrescu diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-qualified-auto.rst @@ -65,7 +65,7 @@ auto *Foo2 = cast(Bar2); auto &Foo3 = cast(Bar3); -If AddConstToQualified is set to `false`, it will be transformed into: +If AddConstToQualified is set to `false`, it will be transformed into: .. code-block:: c++ diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-redundant-declaration.rst @@ -16,7 +16,7 @@ extern int X; -Such redundant declarations can be removed without changing program behaviour. +Such redundant declarations can be removed without changing program behavior. They can for instance be unintentional left overs from previous refactorings when code has been moved around. Having redundant declarations could in worst case mean that there are typos in the code that cause bugs. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-string-compare.rst @@ -49,6 +49,6 @@ if (str1.compare("foo") == 0) { } -The above code examples shows the list of if-statements that this check will +The above code examples show the list of if-statements that this check will give a warning for. All of them uses ``compare`` to check if equality or inequality of two strings instead of using the correct operators. diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst b/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst --- a/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst @@ -109,10 +109,10 @@ The default bounds are: below `50`\% dissimilar and above `66`\% similar. This heuristic is case-sensitive. -Jaro–Winkler distance (as `JaroWinkler`) +Jaro-Winkler distance (as `JaroWinkler`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The `Jaro–Winkler distance `_ +The `Jaro-Winkler distance `_ is an edit distance like the Levenshtein distance. It is calculated from the amount of common characters that are sufficiently close to each other in position, and to-be-changed characters. @@ -125,10 +125,10 @@ The default bounds are: below `75`\% dissimilar and above `85`\% similar. This heuristic is case-insensitive. -Sørensen–Dice coefficient (as `Dice`) +Sørensen-Dice coefficient (as `Dice`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The `Sørensen–Dice coefficient `_ +The `Sørensen-Dice coefficient `_ was originally defined to measure the similarity of two sets. Formally, the coefficient is calculated by dividing `2 * #(intersection)` with `#(set1) + #(set2)`, where `#()` is the cardinality function of sets. diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst --- a/clang-tools-extra/docs/clang-tidy/index.rst +++ b/clang-tools-extra/docs/clang-tidy/index.rst @@ -91,7 +91,7 @@ Clang diagnostics are treated in a similar way as check diagnostics. Clang diagnostics are displayed by :program:`clang-tidy` and can be filtered out using ``-checks=`` option. However, the ``-checks=`` option does not affect -compilation arguments, so it can not turn on Clang warnings which are not +compilation arguments, so it cannot turn on Clang warnings which are not already turned on in build configuration. The ``-warnings-as-errors=`` option upgrades any warnings emitted under the ``-checks=`` flag to errors (but it does not enable any checks itself). @@ -281,10 +281,10 @@ ================================= :program:`clang-tidy` diagnostics are intended to call out code that does not -adhere to a coding standard, or is otherwise problematic in some way. However, +adhere to a coding standard, or is otherwise problematic in some way. However, if the code is known to be correct, it may be useful to silence the warning. Some clang-tidy checks provide a check-specific way to silence the diagnostics, -e.g. `bugprone-use-after-move `_ can be +e.g. `bugprone-use-after-move `_ can be silenced by re-initializing the variable after it has been moved out, `bugprone-string-integer-assignment `_ can be suppressed by