[clang-tools-extra] [clang-tidy] Add readability-redundant-override check (PR #242955)

via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 15 19:56:48 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE LINT COMMENT: clang-tidy-->


:warning: C/C++ code linter, clang-tidy found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

```bash

git diff -U0 origin/main...HEAD -- clang-tools-extra/clang-tidy/readability/RedundantOverrideCheck.cpp clang-tools-extra/clang-tidy/readability/RedundantOverrideCheck.h clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp |
python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py   -path build -p1 -quiet
```

</details>

<details>
<summary>
View the output from clang-tidy here.
</summary>

```
clang-tools-extra/clang-tidy/readability/RedundantOverrideCheck.cpp:53:46: warning: variable 'Context' of type 'ASTContext &' can be declared 'const' [misc-const-correctness]
   53 |                                              ASTContext &Context) {
      |                                              ^
      |                                                          const
clang-tools-extra/clang-tidy/readability/RedundantOverrideCheck.cpp:80:8: warning: static member accessed through instance [readability-static-accessed-through-instance]
   80 |       !Context.hasSameType(Method->getType(), Base->getType()) ||
      |        ^~~~~~~~
      |        clang::ASTContext::
clang-tools-extra/clang-tidy/readability/RedundantOverrideCheck.cpp:216:10: warning: variable 'Range' of type 'CharSourceRange' can be declared 'const' [misc-const-correctness]
  216 |     for (CharSourceRange Range : Ranges)
      |          ^
      |                          const
```

</details>


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


More information about the cfe-commits mailing list