[PATCH] D113830: [clang-tidy] Fix false positive in `readability-identifier-naming` check involving `override` attribute

Salman Javed via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 14 02:48:25 PST 2021


salman-javed-nz added inline comments.


================
Comment at: clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp:329
+
+  // FIXME: The fixes from ATOverridden should be propagated to the following call
+  a_vTitem.BadBaseMethod();
----------------
The fixes /do/ seem to be propagated if there is an explicit template instantiation.

```lang=cpp
template <typename T>
struct A
{
    virtual void method() {}
};

template <typename U>
struct B : A<U>
{
    void method() override {}
    void CallVirtual() { this->method(); }
};

template class B<int>;
```

Running with `clang-tidy -fix` and `readability-identifier-naming.FunctionCase = CamelCase` gives:
```lang=cpp
template <typename T>
struct A
{
    virtual void Method() {}
};

template <typename U>
struct B : A<U>
{
    void Method() override {}
    void CallVirtual() { this->Method(); }
};

template class B<int>;
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113830/new/

https://reviews.llvm.org/D113830



More information about the cfe-commits mailing list