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 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/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: @@ -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-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-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,8 +25,8 @@ for (short i = 0; i < items.size(); ++i) {} } -This algorithm works for small amount of objects, but will lead to freeze for a -larger user input. +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/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 @@ -14,17 +14,17 @@ We enforce only part of the guideline, more specifically, we flag narrowing conversions from: - an integer to a narrower integer (e.g. ``char`` to ``unsigned char``) - if WarnOnIntegerNarrowingConversion Option is set, + if WarnOnIntegerNarrowingConversion option is set, - an integer to a narrower floating-point (e.g. ``uint64_t`` to ``float``), - a floating-point to an integer (e.g. ``double`` to ``int``), - a floating-point to a narrower floating-point (e.g. ``double`` to ``float``) - if WarnOnFloatingPointNarrowingConversion Option is set. + if WarnOnFloatingPointNarrowingConversion option is set. This check will flag: - All narrowing conversions that are not marked by an explicit cast (c-style or ``static_cast``). For example: ``int i = 0; i += 0.1;``, ``void f(int); f(0.1);``, - - All applications of binary operators with a narrowing conversions. + - All applications of binary operators with a narrowing conversion. For example: ``int i; i+= 0.1;``. 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/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/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-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 @@ -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-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++ 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-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-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-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/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).