diff options
author | Jonas Toth <jonas.toth@gmail.com> | 2018-11-05 22:21:27 +0000 |
---|---|---|
committer | Jonas Toth <jonas.toth@gmail.com> | 2018-11-05 22:21:27 +0000 |
commit | dafbf9915b13d6771ff54f8eced970cc39dcf6c1 (patch) | |
tree | c8bad9d8aaa75a4aed6d1c87ac22088cd8a18e1f /clang-tools-extra/docs | |
parent | 249152357d4a91f8b755db91df7f1527282ef656 (diff) |
[clang-tidy] doc removew hitespace in front of code-block-line
Diffstat (limited to 'clang-tools-extra/docs')
11 files changed, 30 insertions, 30 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst index ebeb82916c8..929616630cb 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst @@ -11,7 +11,7 @@ It doesn't replace conversion from floating points despite the ``to_string`` overloads, because it would change the behaviour. - .. code-block:: c++ +.. code-block:: c++ auto str = boost::lexical_cast<std::string>(42); auto wstr = boost::lexical_cast<std::wstring>(2137LL); diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst index ddf69dca93d..61255e7596b 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-forwarding-reference-overload.rst @@ -13,7 +13,7 @@ Item 26. Consider the following example: - .. code-block:: c++ +.. code-block:: c++ class Person { public: diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst index 3b57d50549e..b249ac6d32c 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-move-forwarding-reference.rst @@ -5,7 +5,7 @@ bugprone-move-forwarding-reference Warns if ``std::move`` is called on a forwarding reference, for example: - .. code-block:: c++ +.. code-block:: c++ template <typename T> void foo(T&& t) { @@ -22,7 +22,7 @@ function template argument.) In this example, the suggested fix would be - .. code-block:: c++ +.. code-block:: c++ bar(std::forward<T>(t)); @@ -34,7 +34,7 @@ Code like the example above is sometimes written with the expectation that deduced for ``T``, and that it is therefore not possible to pass an lvalue to ``foo()``. However, this is not true. Consider this example: - .. code-block:: c++ +.. code-block:: c++ std::string s = "Hello, world"; foo(s); diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst index a3eb098aa9d..76c891f3def 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-semicolon.rst @@ -9,7 +9,7 @@ the code. More specifically, it looks for ``if``, ``while``, ``for`` and context of the code (e.g. indentation) in an attempt to determine whether that is intentional. - .. code-block:: c++ +.. code-block:: c++ if (x < y); { @@ -20,7 +20,7 @@ Here the body of the ``if`` statement consists of only the semicolon at the end of the first line, and `x` will be incremented regardless of the condition. - .. code-block:: c++ +.. code-block:: c++ while ((line = readLine(file)) != NULL); processLine(line); @@ -30,7 +30,7 @@ As a result of this code, `processLine()` will only be called once, when the the code indicates the intention of the programmer. - .. code-block:: c++ +.. code-block:: c++ if (x >= y); x -= y; @@ -43,7 +43,7 @@ To solve the issue remove the stray semicolon or in case the empty body is intentional, reflect this using code indentation or put the semicolon in a new line. For example: - .. code-block:: c++ +.. code-block:: c++ while (readWhitespace()); Token t = readNextToken(); @@ -54,14 +54,14 @@ semicolon at the end of the first line. Either remove the indentation from the second line: - .. code-block:: c++ +.. code-block:: c++ while (readWhitespace()); Token t = readNextToken(); ... or move the semicolon from the end of the first line to a new line: - .. code-block:: c++ +.. code-block:: c++ while (readWhitespace()) ; diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone-use-after-move.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone-use-after-move.rst index ac16a0a2131..9fde912837d 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone-use-after-move.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone-use-after-move.rst @@ -5,7 +5,7 @@ bugprone-use-after-move Warns if an object is used after it has been moved, for example: - .. code-block:: c++ +.. code-block:: c++ std::string str = "Hello, world!\n"; std::vector<std::string> messages; @@ -18,7 +18,7 @@ moved. The check does not trigger a warning if the object is reinitialized after the move and before the use. For example, no warning will be output for this code: - .. code-block:: c++ +.. code-block:: c++ messages.emplace_back(std::move(str)); str = "Greetings, stranger!\n"; @@ -28,7 +28,7 @@ The check takes control flow into account. A warning is only emitted if the use can be reached from the move. This means that the following code does not produce a warning: - .. code-block:: c++ +.. code-block:: c++ if (condition) { messages.emplace_back(std::move(str)); @@ -38,7 +38,7 @@ produce a warning: On the other hand, the following code does produce a warning: - .. code-block:: c++ +.. code-block:: c++ for (int i = 0; i < 10; ++i) { std::cout << str; @@ -50,7 +50,7 @@ On the other hand, the following code does produce a warning: In some cases, the check may not be able to detect that two branches are mutually exclusive. For example (assuming that ``i`` is an int): - .. code-block:: c++ +.. code-block:: c++ if (i == 1) { messages.emplace_back(std::move(str)); @@ -65,7 +65,7 @@ not possible for both the move and the use to be executed. An erroneous warning can be silenced by reinitializing the object after the move: - .. code-block:: c++ +.. code-block:: c++ if (i == 1) { messages.emplace_back(std::move(str)); @@ -86,7 +86,7 @@ sub-expressions of a statement are evaluated. This means that in code like the following, it is not guaranteed whether the use will happen before or after the move: - .. code-block:: c++ +.. code-block:: c++ void f(int i, std::vector<int> v); std::vector<int> v = { 1, 2, 3 }; @@ -124,7 +124,7 @@ that consumes this parameter does not move from it, or if it does so only conditionally. For example, in the following situation, the check will assume that a move always takes place: - .. code-block:: c++ +.. code-block:: c++ std::vector<std::string> messages; void f(std::string &&str) { @@ -186,7 +186,7 @@ that struct is written to, the check does not consider this to be a reinitialization -- even if, eventually, all member variables of the struct are written to. For example: - .. code-block:: c++ +.. code-block:: c++ struct S { std::string str; 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 index 28a5e8e5a0d..41a214b31ae 100644 --- 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 @@ -28,7 +28,7 @@ Options When set to `1` (default is `0`), this check doesn't flag classes with a sole, explicitly defaulted destructor. An example for such a class is: - .. code-block:: c++ +.. code-block:: c++ struct A { virtual ~A() = default; @@ -40,7 +40,7 @@ Options operations at all. It still flags classes which define only one of either move constructor or move assignment operator. With this option enabled, the following class won't be flagged: - .. code-block:: c++ +.. code-block:: c++ struct A { A(const A&); diff --git a/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst b/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst index f01bfedad25..64ad9bda408 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/google-build-using-namespace.rst @@ -11,7 +11,7 @@ The check implements the following rule of the You may not use a using-directive to make all names from a namespace available. - .. code-block:: c++ +.. code-block:: c++ // Forbidden -- This pollutes the namespace. using namespace foo; diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst index 1dfbf952b4f..f49648d46aa 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-pass-by-value.rst @@ -13,7 +13,7 @@ The transformation is usually beneficial when the calling code passes an *rvalue* and assumes the move construction is a cheap operation. This short example illustrates how the construction of the value happens: - .. code-block:: c++ +.. code-block:: c++ void foo(std::string s); std::string get_str(); @@ -39,7 +39,7 @@ 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. - .. code-block:: c++ +.. code-block:: c++ #include <string> 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 1cbd68cb718..87321316e00 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 @@ -46,7 +46,7 @@ Known Limitations sense and usually ``std::auto_ptr`` are stored by value (otherwise what is the point in using them instead of a reference or a pointer?). - .. code-block:: c++ +.. code-block:: c++ // <3rd-party header...> std::auto_ptr<int> get_value(); @@ -61,7 +61,7 @@ Known Limitations * Non-instantiated templates aren't modified. - .. code-block:: c++ +.. code-block:: c++ template <typename X> void f() { diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-emplace.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-emplace.rst index 533125e9bf0..b01b4481ecd 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-emplace.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-emplace.rst @@ -107,7 +107,7 @@ Options When non-zero, the check will ignore implicitly constructed arguments of ``push_back``, e.g. - .. code-block:: c++ +.. code-block:: c++ std::vector<std::string> v; v.push_back("a"); // Ignored when IgnoreImplicitConstructors is ``1``. diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-transparent-functors.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-transparent-functors.rst index 88872751e40..20f95594828 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/modernize-use-transparent-functors.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-use-transparent-functors.rst @@ -8,7 +8,7 @@ functors, the type does not need to be repeated. The code is easier to read, maintain and less prone to errors. It is not possible to introduce unwanted conversions. - .. code-block:: c++ +.. code-block:: c++ // Non-transparent functor std::map<int, std::string, std::greater<int>> s; @@ -22,7 +22,7 @@ conversions. It is not always a safe transformation though. The following case will be untouched to preserve the semantics. - .. code-block:: c++ +.. code-block:: c++ // Non-transparent functor std::map<const char *, std::string, std::greater<std::string>> s; |