Index: clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp =================================================================== --- clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp +++ clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp @@ -1257,7 +1257,7 @@ if (const auto *Decl = dyn_cast(D)) { if (Decl->isMain() || !Decl->isUserProvided() || - Decl->size_overridden_methods() > 0) + Decl->size_overridden_methods() > 0 || Decl->hasAttr()) return SK_Invalid; // If this method has the same name as any base method, this is likely Index: clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming.cpp @@ -305,9 +305,29 @@ } }; -void VirtualCall(AOverridden &a_vItem) { +template +class ATOverridden { +public: + virtual void BadBaseMethod() = 0; + // CHECK-MESSAGES: :[[@LINE-1]]:16: warning: invalid case style for virtual method 'BadBaseMethod' + // CHECK-FIXES: {{^}} virtual void v_Bad_Base_Method() = 0; +}; + +template +class CTOverriding : public ATOverridden { + // Overriding a badly-named base isn't a new violation. + // FIXME: The fixes from the base class should be propagated to the derived class here + // (note that there could be specializations of the template base class, though) + void BadBaseMethod() override{} +}; + +template +void VirtualCall(AOverridden &a_vItem, ATOverridden &a_vTitem) { a_vItem.BadBaseMethod(); // CHECK-FIXES: {{^}} a_vItem.v_Bad_Base_Method(); + + // FIXME: The fixes from ATOverridden should be propagated to the following call + a_vTitem.BadBaseMethod(); } template