forked from OSchip/llvm-project
[clang-tidy] Fixed formatting of headings in the docs.
llvm-svn: 248151
This commit is contained in:
parent
5c2cb0eee2
commit
3e748fbd17
|
@ -11,10 +11,10 @@ Three kinds of loops can be converted:
|
|||
- Loops over array-like containers, using ``operator[]`` and ``at()``.
|
||||
|
||||
MinConfidence option
|
||||
====================
|
||||
--------------------
|
||||
|
||||
risky
|
||||
-----
|
||||
^^^^^
|
||||
|
||||
In loops where the container expression is more complex than just a
|
||||
reference to a declared expression (a variable, function, enum, etc.),
|
||||
|
@ -40,7 +40,7 @@ for an example of an incorrect transformation when the minimum required confiden
|
|||
level is set to `risky`.
|
||||
|
||||
reasonable (Default)
|
||||
--------------------
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If a loop calls ``.end()`` or ``.size()`` after each iteration, the
|
||||
transformation for that loop is marked as `reasonable`, and thus will
|
||||
|
@ -54,7 +54,7 @@ be converted if the required confidence level is set to ``reasonable``
|
|||
cout << container[i];
|
||||
|
||||
safe
|
||||
----
|
||||
^^^^
|
||||
|
||||
Any other loops that do not match the above criteria to be marked as
|
||||
`risky` or `reasonable` are marked `safe`, and thus will be converted
|
||||
|
@ -68,7 +68,7 @@ if the required confidence level is set to ``safe`` or lower.
|
|||
cout << arr[i];
|
||||
|
||||
Example
|
||||
=======
|
||||
-------
|
||||
|
||||
Original:
|
||||
|
||||
|
@ -117,7 +117,7 @@ After transformation with confidence level set to ``reasonable`` (default):
|
|||
cout << elem;
|
||||
|
||||
Limitations
|
||||
===========
|
||||
-----------
|
||||
|
||||
There are certain situations where the tool may erroneously perform
|
||||
transformations that remove information and change semantics. Users of the tool
|
||||
|
@ -125,7 +125,7 @@ should be aware of the behaviour and limitations of the transform outlined by
|
|||
the cases below.
|
||||
|
||||
Comments inside loop headers
|
||||
----------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Comments inside the original loop header are ignored and deleted when
|
||||
transformed.
|
||||
|
@ -135,7 +135,7 @@ transformed.
|
|||
for (int i = 0; i < N; /* This will be deleted */ ++i) { }
|
||||
|
||||
Range-based loops evaluate end() only once
|
||||
------------------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The C++11 range-based for loop calls ``.end()`` only once during the
|
||||
initialization of the loop. If in the original loop ``.end()`` is called after
|
||||
|
@ -201,7 +201,7 @@ transformed loop if ``.end()`` was originally called after each iteration.
|
|||
}
|
||||
|
||||
Overloaded operator->() with side effects
|
||||
-----------------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Similarly, if ``operator->()`` was overloaded to have side effects, such as
|
||||
logging, the semantics will change. If the iterator's ``operator->()`` was used
|
||||
|
@ -221,7 +221,7 @@ performed.
|
|||
}
|
||||
|
||||
Pointers and references to containers
|
||||
-------------------------------------
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
While most of the transform's risk analysis is dedicated to determining whether
|
||||
the iterator or container was modified within the loop, it is possible to
|
||||
|
|
|
@ -25,12 +25,12 @@ Migration example:
|
|||
+ take_ownership_fn(std::move(b));
|
||||
}
|
||||
|
||||
Since `std::move()` is a library function declared in `<utility>` it may be
|
||||
Since ``std::move()`` is a library function declared in ``<utility>`` it may be
|
||||
necessary to add this include. The transform will add the include directive when
|
||||
necessary.
|
||||
|
||||
Known Limitations
|
||||
=================
|
||||
-----------------
|
||||
* If headers modification is not activated or if a header is not allowed to be
|
||||
changed this transform will produce broken code (compilation error), where the
|
||||
the headers' code will stay unchanged while the code using them will be
|
||||
|
|
|
@ -34,7 +34,7 @@ and maintainability. As a result, ``auto`` is used only introduced in specific
|
|||
situations described below.
|
||||
|
||||
Iterators
|
||||
=========
|
||||
---------
|
||||
|
||||
Iterator type specifiers tend to be long and used frequently, especially in
|
||||
loop constructs. Since the functions generating iterators have a common format,
|
||||
|
@ -127,7 +127,7 @@ following conditions are satisfied:
|
|||
deduced as``std::initializer_list``.
|
||||
|
||||
Known Limitations
|
||||
=================
|
||||
-----------------
|
||||
* If the initializer is an explicit conversion constructor, the transform will
|
||||
not replace the type specifier even though it would be safe to do so.
|
||||
* User-defined iterators are not handled at this time.
|
||||
|
|
|
@ -5,7 +5,7 @@ The check converts the usage of null pointer constants (eg. ``NULL``, ``0``)
|
|||
to use the new C++11 ``nullptr`` keyword.
|
||||
|
||||
Example
|
||||
=======
|
||||
-------
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
|
@ -36,7 +36,7 @@ transforms to:
|
|||
|
||||
|
||||
User defined macros
|
||||
===================
|
||||
-------------------
|
||||
|
||||
By default this transform will only replace the ``NULL`` macro and will skip any
|
||||
user-defined macros that behaves like ``NULL``. The user can use the
|
||||
|
@ -44,7 +44,7 @@ user-defined macros that behaves like ``NULL``. The user can use the
|
|||
names that will be transformed along with ``NULL``.
|
||||
|
||||
Example
|
||||
-------
|
||||
^^^^^^^
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
|
@ -62,4 +62,4 @@ transforms to:
|
|||
int *p = nullptr;
|
||||
}
|
||||
|
||||
if the ``UserNullMacros`` option is set to ``MY_NULL``.
|
||||
if the ``UserNullMacros`` option is set to ``MY_NULL``.
|
||||
|
|
Loading…
Reference in New Issue