[all-commits] [llvm/llvm-project] 4d259d: [clang-tidy] Add `IgnoreAliasing` option to `reada...

Juan Besa via All-commits all-commits at lists.llvm.org
Mon Jul 28 08:20:25 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d259de2ae88fb022acc722dedd60260a870eb8b
      https://github.com/llvm/llvm-project/commit/4d259de2ae88fb022acc722dedd60260a870eb8b
  Author: Juan Besa <juanbesa at gmail.com>
  Date:   2025-07-28 (Mon, 28 Jul 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.cpp
    M clang-tools-extra/clang-tidy/readability/QualifiedAutoCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/readability/qualified-auto.rst
    M clang-tools-extra/test/clang-tidy/checkers/readability/qualified-auto.cpp

  Log Message:
  -----------
  [clang-tidy] Add `IgnoreAliasing` option to `readability-qualified-auto check` (#147060)

`readability-qualified-auto` check currently looks at the unsugared
type, skipping any typedefs, to determine if the variable is a
pointer-type. This may not be the desired behaviour, in particular when
the type depends on compilation flags.
For example

```
 #if CONDITION
      using Handler = int *;
  #else
      using Handler = uint64_t;
  #endif
```

A more common example is some implementations of `std::array` use
pointers as iterators.

This introduces the IgnoreAliasing option so that
`readability-qualified-auto` does not look beyond typedefs.

---------

Co-authored-by: juanbesa <juanbesa at devvm33299.lla0.facebook.com>
Co-authored-by: Kazu Hirata <kazu at google.com>
Co-authored-by: EugeneZelenko <eugene.zelenko at gmail.com>
Co-authored-by: Baranov Victor <bar.victor.2002 at gmail.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list