Skip to content

[clang-tidy][docs][NFC] Make uniform "Limitations" sections across all checks #151863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ virtual functions, thereby improving the overall stability and maintainability
of your code. In scenarios involving pointers to member virtual functions, it's
only advisable to employ ``nullptr`` for comparisons.


Limitations
-----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ outcomes. The check ensures that the copy constructor of a derived class
properly calls the copy constructor of the base class, helping to prevent bugs
and improve code quality.

Limitations:

Limitations
-----------

* It won't generate warnings for empty classes, as there are no class members
(including base class sub-objects) to worry about.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ Example:

CRTP<int> AlsoCompileTimeError;

Limitations:

Limitations
-----------

* The check is not supported below C++11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ This check only detects range-based for loops over unordered sets and maps. It
also detects calls sorting-like algorithms on containers holding pointers.
Other similar usages will not be found and are false negatives.

Limitations:

Limitations
-----------

* This check currently does not check if a nondeterministic iteration order is
likely to be a mistake, and instead marks all such iterations as bugprone.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ Every possible change is considered, thus if the condition variable is not
a local variable of the function, it is a volatile or it has an alias (pointer
or reference) then no warning is issued.

Known limitations
^^^^^^^^^^^^^^^^^

Limitations
-----------

The ``else`` branch is not checked currently for negated condition variable:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@ This check corresponds to the CERT C Coding Standard rule
`ARR39-C. Do not add or subtract a scaled integer to a pointer
<http://wiki.sei.cmu.edu/confluence/display/c/ARR39-C.+Do+not+add+or+subtract+a+scaled+integer+to+a+pointer>`_.


Limitations
"""""""""""
-----------

Cases where the pointee type has a size of `1` byte (such as, and most
importantly, ``char``) are excluded.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ A call to ``clear()`` would appropriately clear the contents of the range:
...
v.clear();

Limitations:

Limitations
-----------

* Doesn't warn if ``empty()`` is defined and used with the ignore result in the
class template definition (for example in the library implementation). These
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ Note that there is the check
:doc:`cppcoreguidelines-avoid-non-const-global-variables <../cppcoreguidelines/avoid-non-const-global-variables>`
to enforce ``const`` correctness on all globals.

Known Limitations
-----------------

Limitations
-----------

The check does not run on `C` code.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ References:
* JPL Institutional Coding Standard for the C Programming Language (JPL DOCID D-60411) rule `2.4 Do not use direct or indirect recursion`.
* OpenCL Specification, Version 1.2 rule `6.9 Restrictions: i. Recursion is not supported. <https://www.khronos.org/registry/OpenCL/specs/opencl-1.2.pdf>`_.

Limitations:

Limitations
-----------

* The check does not handle calls done through function pointers
* The check does not handle C++ destructors
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Options
A string specifying which include-style is used, `llvm` or `google`. Default
is `llvm`.


Limitations
-----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ untouched:
};


Known limitations
^^^^^^^^^^^^^^^^^
Limitations
-----------

A situation where the generated code can be wrong is when the object referenced
is modified before the assignment in the init-list through a "hidden" reference.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ Since ``std::move()`` is a library function declared in ``<utility>`` it may be
necessary to add this include. The check will add the include directive when
necessary.

Known Limitations
-----------------

Limitations
-----------

* If headers modification is not activated or if a header is not allowed to be
changed this check will produce broken code (compilation error), where the
headers' code will stay unchanged while the code using them will be changed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ It will be transformed to this:
const Foo &operator=(const Foo &) = delete;
};

Known Limitations
-----------------

Limitations
-----------

* Notice that the migration example above leaves the ``private`` access
specification untouched. You might want to run the check :doc:`modernize-use-equals-delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Options

Defaults to `false`.


Limitations
-----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ that behave as casts, such as ``llvm::dyn_cast``, ``boost::lexical_cast`` and
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.

Known Limitations
-----------------

Limitations
-----------

* If the initializer is an explicit conversion constructor, the check will not
replace the type specifier even though it would be safe to do so.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ transforms to:
virtual auto f3() const && -> float = delete;
auto lambda = []() -> void {};

Known Limitations
-----------------

Limitations
-----------

The following categories of return types cannot be rewritten currently:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ set to `2` or smaller. If the option DescribeBasicIncrements is set to `true`,
it will additionally flag the two `if` statements with the amounts by which they
increase to the complexity of the function and the current nesting level.


Limitations
-----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Examples:
foo1();
foo2(); // Not guarded by if(cond1).


Limitations
-----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Note in the LLVM alias, the default value is `false`.
Otherwise no changes will occur.


Limitations
-----------

Expand Down
Loading