From 3e748fbd176f282d8dec116081a88d91a3f70c04 Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Mon, 21 Sep 2015 12:13:27 +0000 Subject: [PATCH] [clang-tidy] Fixed formatting of headings in the docs. llvm-svn: 248151 --- .../checks/modernize-loop-convert.rst | 20 +++++++++---------- .../checks/modernize-replace-auto-ptr.rst | 4 ++-- .../clang-tidy/checks/modernize-use-auto.rst | 4 ++-- .../checks/modernize-use-nullptr.rst | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) 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 index 9e7e1ca5a9fe..9d8a7f8a722c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-loop-convert.rst @@ -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 diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst index 46070ef6db0b..595092b8c2d5 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-replace-auto-ptr.rst @@ -25,12 +25,12 @@ Migration example: + take_ownership_fn(std::move(b)); } -Since `std::move()` is a library function declared in `` it may be +Since ``std::move()`` is a library function declared in ```` 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 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 index d9347707a5e8..1bb6a6e47a9c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-auto.rst @@ -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. 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 index ef1a5fd287e6..29fb4b4a3c1c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-nullptr.rst @@ -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``.