summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/misc-misplaced-const.rst
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/misc-misplaced-const.rst')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/misc-misplaced-const.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-misplaced-const.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-misplaced-const.rst
index c51a82b64bd..a0471e2e0a6 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/misc-misplaced-const.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/misc-misplaced-const.rst
@@ -3,19 +3,20 @@
misc-misplaced-const
====================
-This check diagnoses when a const qualifier is applied to a typedef to a pointer
-type rather than to the pointee, because such constructs are often misleading to
-developers because the const applies to the pointer rather than the pointee.
+This check diagnoses when a ``const`` qualifier is applied to a ``typedef`` to a
+pointer type rather than to the pointee, because such constructs are often
+misleading to developers because the ``const`` applies to the pointer rather
+than the pointee.
-For instance, in the following code, the resulting type is `int *` const rather
-than `const int *`:
+For instance, in the following code, the resulting type is ``int *`` ``const``
+rather than ``const int *``:
.. code:: c++
typedef int *int_ptr;
void f(const int_ptr ptr);
-The check does not diagnose when the underlying typedef type is a pointer to a
-const type or a function pointer type. This is because the const qualifier is
-less likely to be mistaken because it would be redundant (or disallowed) on the
-underlying pointee type.
+The check does not diagnose when the underlying ``typedef`` type is a pointer to
+a ``const`` type or a function pointer type. This is because the ``const``
+qualifier is less likely to be mistaken because it would be redundant (or
+disallowed) on the underlying pointee type.
OpenPOWER on IntegriCloud