Author: Aaron Ballman Date: 2023-12-06T07:41:31-05:00 New Revision: a9673bd1ca217e46800f3c2b705c1bed01fdc457
URL: https://github.com/llvm/llvm-project/commit/a9673bd1ca217e46800f3c2b705c1bed01fdc457 DIFF: https://github.com/llvm/llvm-project/commit/a9673bd1ca217e46800f3c2b705c1bed01fdc457.diff LOG: Fix code blocks so that they render properly It's rather disturbing that malformed syntax does not generate any warnings or errors when building either locally or on the bots. Added: Modified: clang/docs/InternalsManual.rst Removed: ################################################################################ diff --git a/clang/docs/InternalsManual.rst b/clang/docs/InternalsManual.rst index f8e3da5f97368..4994b3ffa6ebb 100644 --- a/clang/docs/InternalsManual.rst +++ b/clang/docs/InternalsManual.rst @@ -3375,7 +3375,7 @@ truncated text instead.) Here's an example of the most commonly used way to specify expected diagnostics: -.. code-block: c++ +.. code-block:: c++ int A = B; // expected-error {{use of undeclared identifier 'B'}} @@ -3385,7 +3385,7 @@ more readable, you can use slash-newline to separate out the diagnostics. Alternatively, it is possible to specify the line on which the diagnostic should appear by appending ``@<line>`` to ``expected-<type>``, for example: -.. code-block: c++ +.. code-block:: c++ #warning some text // expected-warning@10 {{some text}} @@ -3398,7 +3398,7 @@ header file, it may be beneficial to be able to declare the file in which the diagnostic will appear, rather than placing the ``expected-*`` directive in the actual file itself. This can be done using the following syntax: -.. code-block: c++ +.. code-block:: c++ // expected-error@path/include.h:15 {{error message}} @@ -3413,7 +3413,7 @@ diagnostic can instead be indicated by a marker of the form ``#<marker>``. Markers are specified by including them in a comment, and then referenced by appending the marker to the diagnostic with ``@#<marker>``, as with: -.. code-block: c++ +.. code-block:: c++ #warning some text // #1 // ... other code ... @@ -3428,14 +3428,14 @@ syntax is ``expected-<type> <n> {{diag text}}``, where ``<type>`` is one of integer. This allows the diagnostic to appear as many times as specified. For example: -.. code-block: c++ +.. code-block:: c++ void f(); // expected-note 2 {{previous declaration is here}} Where the diagnostic is expected to occur a minimum number of times, this can be specified by appending a ``+`` to the number. For example: -.. code-block: c++ +.. code-block:: c++ void f(); // expected-note 0+ {{previous declaration is here}} void g(); // expected-note 1+ {{previous declaration is here}} @@ -3445,13 +3445,13 @@ swallowed if it occurs, but will not generate an error if it does not occur. In the second example, the diagnostic must occur at least once. As a short-hand, "one or more" can be specified simply by ``+``. For example: -.. code-block: c++ +.. code-block:: c++ void g(); // expected-note + {{previous declaration is here}} A range can also be specified by ``<n>-<m>``. For example: -.. code-block: c++ +.. code-block:: c++ void f(); // expected-note 0-1 {{previous declaration is here}} @@ -3460,13 +3460,13 @@ In this example, the diagnostic may appear only once, if at all. Regex matching mode may be selected by appending ``-re`` to the diagnostic type and including regexes wrapped in double curly braces in the directive, such as: -.. code-block: c++ +.. code-block:: text expected-error-re {{format specifies type 'wchar_t **' (aka '{{.+}}')}} Examples matching error: "variable has incomplete type 'struct s'" -.. code-block: c++ +.. code-block:: c++ // expected-error {{variable has incomplete type 'struct s'}} // expected-error {{variable has incomplete type}} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits