[llvm-branch-commits] [clang-tools-extra] [clang-tidy][docs] Rewrite readability check docs to Markdown [3/5] (PR #221534)

Baranov Victor via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 7 01:28:18 PDT 2026


================
@@ -1,141 +1,138 @@
-.. title:: clang-tidy - readability-qualified-auto
+```{title} clang-tidy - readability-qualified-auto
+```
 
-readability-qualified-auto
-==========================
+# readability-qualified-auto
 
-Adds pointer qualifications to ``auto``-typed variables that are deduced to
+Adds pointer qualifications to `auto`-typed variables that are deduced to
 pointers.
 
-`LLVM Coding Standards <https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto>`_
-advises to make it obvious if a ``auto`` typed variable is a pointer. This
-check will transform ``auto`` to ``auto *`` when the type is deduced to be a
+[LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto)
+advises to make it obvious if a `auto` typed variable is a pointer. This
+check will transform `auto` to `auto *` when the type is deduced to be a
 pointer.
 
-.. code-block:: c++
-
-  for (auto Data : MutatablePtrContainer) {
-    change(*Data);
-  }
-  for (auto Data : ConstantPtrContainer) {
-    observe(*Data);
-  }
+```c++
+for (auto Data : MutatablePtrContainer) {
+  change(*Data);
+}
+for (auto Data : ConstantPtrContainer) {
+  observe(*Data);
+}
+```
 
 Would be transformed into:
 
-.. code-block:: c++
-
-  for (auto *Data : MutatablePtrContainer) {
-    change(*Data);
-  }
-  for (const auto *Data : ConstantPtrContainer) {
-    observe(*Data);
-  }
-
-Note ``const`` ``volatile`` qualified types will retain their ``const`` and
-``volatile`` qualifiers. Pointers to pointers will not be fully qualified.
-
-.. code-block:: c++
-
-  const auto Foo = cast<int *>(Baz1);
-  const auto Bar = cast<const int *>(Baz2);
-  volatile auto FooBar = cast<int *>(Baz3);
-  auto BarFoo = cast<int **>(Baz4);
+```c++
+for (auto *Data : MutatablePtrContainer) {
+  change(*Data);
+}
+for (const auto *Data : ConstantPtrContainer) {
+  observe(*Data);
+}
+```
+
+Note `const` `volatile` qualified types will retain their `const` and
+`volatile` qualifiers. Pointers to pointers will not be fully qualified.
+
+```c++
+const auto Foo = cast<int *>(Baz1);
+const auto Bar = cast<const int *>(Baz2);
+volatile auto FooBar = cast<int *>(Baz3);
+auto BarFoo = cast<int **>(Baz4);
+```
 
 Would be transformed into:
 
-.. code-block:: c++
-
-  auto *const Foo = cast<int *>(Baz1);
-  const auto *const Bar = cast<const int *>(Baz2);
-  auto *volatile FooBar = cast<int *>(Baz3);
-  auto *BarFoo = cast<int **>(Baz4);
-
-Options
--------
-
-.. option:: AddConstToQualified
+```c++
+auto *const Foo = cast<int *>(Baz1);
+const auto *const Bar = cast<const int *>(Baz2);
+auto *volatile FooBar = cast<int *>(Baz3);
+auto *BarFoo = cast<int **>(Baz4);
+```
 
-   When set to `true` the check will add const qualifiers variables defined as
-   ``auto *`` or ``auto &`` when applicable.
-   Default value is `true`.
+## Options
 
-.. code-block:: c++
+```{option} AddConstToQualified
+When `true`, the check will add const qualifiers to variables defined as
+`auto *` or `auto &` when applicable.
+Default is `true`.
+```
 
-   auto Foo1 = cast<const int *>(Bar1);
-   auto *Foo2 = cast<const int *>(Bar2);
-   auto &Foo3 = cast<const int &>(Bar3);
+```c++
----------------
vbvictor wrote:

Could we add this inside option?

https://github.com/llvm/llvm-project/pull/221534


More information about the llvm-branch-commits mailing list