[clang-tools-extra] [clang-tidy] added `RespectOpaqueTypes` option to `readability-qualified-auto check` (PR #147060)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 14 08:51:37 PDT 2025


================
@@ -96,3 +96,23 @@ Note in the LLVM alias, the default value is `false`.
   matched against only the type name (i.e. ``Type``). E.g. to suppress reports
   for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string.
   The default is an empty string.
+
+.. option:: RespectOpaqueTypes
+
+  If set to `false` the check will use the canonical type to determine the type that ``auto`` is deduced to.
+  If set to `true` the check will not look beyond the first type alias. Default value is `false`.
+
+.. code-block:: c++
+
+   using IntPtr = int*;
+   IntPtr foo();
+
+   auto bar = foo();
+
+If RespectOpaqueTypes is set to `false`, it will be transformed into:
----------------
EugeneZelenko wrote:

```suggestion
If :option:`RespectOpaqueTypes` is set to `false`, it will be transformed into:
```

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


More information about the cfe-commits mailing list