.. toctree::
:maxdepth: 1
-:program:`clang-doc` is a tool for generating C and C++ documenation from
+:program:`clang-doc` is a tool for generating C and C++ documentation from
source code and comments.
The tool is in a very early development stage, so you might encounter bugs and
generated if the file is in this dir.
--stylesheets=<string> - CSS stylesheets to extend the default styles.
-The following flags shoud only be used if ``format`` is set to ``html``:
+The following flags should only be used if ``format`` is set to ``html``:
- ``repository``
- ``source-root``
- ``stylesheets``
Set to 1 if you want to insert ``#include`` for the symbol under the cursor.
Default is 0. Compared to normal mode, this mode won't parse the source file
- and only search the sysmbol from database, which is faster than normal mode.
+ and only search the symbol from database, which is faster than normal mode.
See ``clang-include-fixer.py`` for more details.
Checks for cases where arguments to ``absl::Duration`` factory functions are
scaled internally and could be changed to a different factory function. This
-check also looks for arguements with a zero value and suggests using
+check also looks for arguments with a zero value and suggests using
``absl::ZeroDuration()`` instead.
Examples:
Note: As with other ``clang-tidy`` checks, it is possible that multiple fixes
-may overlap (as in the case of nested expressions), so not all occurences can
+may overlap (as in the case of nested expressions), so not all occurrences can
be transformed in one run. In particular, this may occur for nested subtraction
expressions. Running ``clang-tidy`` multiple times will find and fix these
overlaps.
=====================
Checks for repeated branches in ``if/else if/else`` chains, consecutive
-repeated branches in ``switch`` statements and indentical true and false
+repeated branches in ``switch`` statements and identical true and false
branches in conditional operators.
.. code-block:: c++
do_something(x, y);
-If this is the inteded behavior, then there is no reason to use a conditional
+If this is the intended behavior, then there is no reason to use a conditional
statement; otherwise the issue can be solved by fixing the branch that is
handled incorrectly.
Comma separated list containing function names which should not throw. An
example value for this parameter can be ``WinMain`` which adds function
- ``WinMain()`` in the Windows API to the list of the funcions which should
+ ``WinMain()`` in the Windows API to the list of the functions which should
not throw. Default value is an empty string.
.. option:: IgnoredExceptions
through:
- Truncation: The following code uses a floating point range and an int
- initial value, so trucation wil happen at every application of ``operator+``
+ initial value, so trucation will happen at every application of ``operator+``
and the result will be `0`, which might not be what the user expected.
.. code-block:: c++
unsigned flag;
flag =
A |
- H; // OK, disjoint value intervalls in the enum types ->probably good use.
+ H; // OK, disjoint value intervals in the enum types ->probably good use.
flag = B | F; // Warning, have common values so they are probably misused.
// Case 2:
bugprone-unused-return-value
============================
-Warns on unused function return values. The checked funtions can be configured.
+Warns on unused function return values. The checked functions can be configured.
Options
-------
The semantic of a ``gsl::owner<T*>`` is mostly like a ``std::unique_ptr<T>``, therefore
assignment of two ``gsl::owner<T*>`` is considered a move, which requires that the
resource ``Owner2`` must have been released before the assignment.
-This kind of condition could be catched in later improvements of this check with
+This kind of condition could be caught in later improvements of this check with
flowsensitive analysis. Currently, the `Clang Static Analyzer` catches this bug
for dynamic memory, but not for general types of resources.
The corresponding style guide rule:
https://google.github.io/styleguide/cppguide.html#Integer_Types.
-Correspondig cpplint.py check: `runtime/int`.
+Corresponding cpplint.py check: `runtime/int`.
Options
-------
.. code-block:: c++
- // A completly degenerated switch will be diagnosed.
+ // A completely degenerated switch will be diagnosed.
int i = 42;
switch(i) {}
This check replaces C standard library headers with their C++ alternatives and
removes redundant ones.
-Improtant note: the Standard doesn't guarantee that the C++ headers declare all
+Important note: the Standard doesn't guarantee that the C++ headers declare all
the same functions in the global namespace. The check in its current form can
break the code that uses library symbols from the global namespace.
Adds ``override`` (introduced in C++11) to overridden virtual functions and
removes ``virtual`` from those functions as it is not required.
-``virtual`` on non base class implementations was used to help indiciate to the
+``virtual`` on non base class implementations was used to help indicate to the
user that a function was virtual. C++ compilers did not use the presence of
-this to signify an overriden function.
+this to signify an overridden function.
In C++ 11 ``override`` and ``final`` keywords were introduced to allow
overridden functions to be marked appropriately. Their presence allows
If set to non-zero, this check will not diagnose ``override`` as redundant
with ``final``. This is useful when code will be compiled by a compiler with
- warning/error checking flags requiring ``override`` explicitly on overriden
+ warning/error checking flags requiring ``override`` explicitly on overridden
members, such as ``gcc -Wsuggest-override``/``gcc -Werror=suggest-override``.
Default is `0`.
Associative containers implements some of the algorithms as methods which
should be preferred to the algorithms in the algorithm header. The methods
-can take advanatage of the order of the elements.
+can take advantage of the order of the elements.
.. code-block:: c++
The rules for generating fix-it hints are:
- in case of conversions from other built-in type to bool, an explicit
- comparison is proposed to make it clear what exaclty is being compared:
+ comparison is proposed to make it clear what exactly is being compared:
- ``bool boolean = floating;`` is changed to
``bool boolean = floating == 0.0f;``,
Most distributions include clangd in a ``clang-tools`` package, or in the full
``llvm`` distribution.
-For some platforms, binaries are also avaliable at `releases.llvm.org
+For some platforms, binaries are also available at `releases.llvm.org
<http://releases.llvm.org/download.html>`__.
:raw-html:`</details>`
`PragmaDiagnosticPush <https://clang.llvm.org/doxygen/classclang_1_1PPCallbacks.html#a0f3ff19762baa38fe6c5c58022d32979>`_ Callback
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-PragmaDiagnosticPush is called when a #pragma gcc dianostic push directive is read.
+PragmaDiagnosticPush is called when a #pragma gcc diagnostic push directive is read.
Argument descriptions:
`PragmaDiagnosticPop <https://clang.llvm.org/doxygen/classclang_1_1PPCallbacks.html#ac94d789873122221fba8d76f6c5ea45e>`_ Callback
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-PragmaDiagnosticPop is called when a #pragma gcc dianostic pop directive is read.
+PragmaDiagnosticPop is called when a #pragma gcc diagnostic pop directive is read.
Argument descriptions:
`PragmaDiagnostic <https://clang.llvm.org/doxygen/classclang_1_1PPCallbacks.html#afe7938f38a83cb7b4b25a13edfdd7bdd>`_ Callback
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-PragmaDiagnostic is called when a #pragma gcc dianostic directive is read.
+PragmaDiagnostic is called when a #pragma gcc diagnostic directive is read.
Argument descriptions: