Closed Quuxplusone closed 2 years ago
Bugzilla Link | PR45815 |
Status | RESOLVED FIXED |
Importance | P normal |
Reported by | Sergio Losilla (sergio.a.losilla@gmail.com) |
Reported on | 2020-05-06 05:48:55 -0700 |
Last modified on | 2021-11-19 12:54:23 -0800 |
Version | unspecified |
Hardware | PC Linux |
CC | alexfh@google.com, djasper@google.com, fabian.wolff@alumni.ethz.ch, klimek@google.com, mail@salmanjaved.org, N.James93@hotmail.co.uk |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
It most definitely should trigger for the Derived<T>::LOL()
as its a function call that has the incorrect case.
Well, not according to the description of readability-identifier-naming (https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html):
"The naming of virtual methods is reported where they occur in the base class, but not where they are overridden, as it can’t be fixed locally there. This also applies for pseudo-override patterns like CRTP."
Remove the template stuff and things work as expected.
Hmmm, on looking there are actually more issues with this than mentioned here. First off what bug you are mentioning is because the check doesn't look for the override attribute, instead it looks for overridden methods. However as it can't see the definition of the LOL
from a template dependent base class it (incorrectly) assumes its not an override.
However the bigger issue is even without the template it doesn't propagate the fixes down to derived classes that override the method
class Base { virtual void LOL() = 0; };
class Derived : public Base { void LOL() override {} };
MainSourceFile: '/home/ce/