diff options
Diffstat (limited to 'clang-tools-extra/docs')
-rw-r--r-- | clang-tools-extra/docs/ReleaseNotes.rst | 16 | ||||
-rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/readability/qualified-auto.rst | 42 |
2 files changed, 58 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 3ea1c51..2de2818 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -67,6 +67,14 @@ Code completion Code actions ^^^^^^^^^^^^ +- New ``Override pure virtual methods`` code action. When invoked on a class + definition, this action automatically generates C++ ``override`` declarations + for all pure virtual methods inherited from its base classes that have not yet + been implemented. The generated method stubs prompts the user for the actual + implementation. The overrides are intelligently grouped under their original + access specifiers (e.g., ``public``, ``protected``), creating new access + specifier blocks if necessary. + Signature help ^^^^^^^^^^^^^^ @@ -128,6 +136,10 @@ Changes in existing checks - Improved :doc:`misc-header-include-cycle <clang-tidy/checks/misc/header-include-cycle>` check performance. +- Improved :doc:`modernize-use-designated-initializers + <clang-tidy/checks/modernize/use-designated-initializers>` check to + suggest using designated initializers for aliased aggregate types. + - Improved :doc:`modernize-use-std-format <clang-tidy/checks/modernize/use-std-format>` check to correctly match when the format string is converted to a different type by an implicit @@ -142,6 +154,10 @@ Changes in existing checks <clang-tidy/checks/portability/template-virtual-member-function>` check to avoid false positives on pure virtual member functions. +- Improved :doc:`readability-qualified-auto + <clang-tidy/checks/readability/qualified-auto>` check by adding the option + `IgnoreAliasing`, that allows not looking at underlying types of type aliases. + Removed checks ^^^^^^^^^^^^^^ diff --git a/clang-tools-extra/docs/clang-tidy/checks/readability/qualified-auto.rst b/clang-tools-extra/docs/clang-tidy/checks/readability/qualified-auto.rst index efa0857..34390e2 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/readability/qualified-auto.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/readability/qualified-auto.rst @@ -96,3 +96,45 @@ 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:: IgnoreAliasing + + If set to `true` the check will use the underlying type to determine the type + that ``auto`` is deduced to. If set to `false` the check will not look beyond + the first type alias. + Default value is `true`. + + .. code-block:: c++ + + using IntPtr = int*; + IntPtr foo(); + + auto bar = foo(); + + If :option:`IgnoreAliasing` is set to `true`, it will be transformed into: + + .. code-block:: c++ + + auto *bar = foo(); + + Otherwise no changes will occur. + +Limitations +----------- + +When :option:`IgnoreAliasing` is set to `false`, there are cases where +Clang has not preserved the type alias and the underlying type will be used so +false positives may occur. + +For example: + +.. code-block:: c++ + + using IntPtr = int *; + + void loopPtr(const std::vector<IntPtr> &VectorIntPtr) { + + // May fail for IgnoreAliasing==false as AST does not have the 'IntPtr' + for (auto Data : VectorIntPtr) { + } + } |