[PATCH] D147924: [clang-tidy] Exclude template instantiations in modernize-use-override

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 10 04:29:48 PDT 2023


njames93 added a comment.

I'm not sure this is really a great improvement.
If the override candidate originates in a templated base class I think we should still warn

  struct Foo {
    virtual void foo();
  };
  
  template <typeame T>
  struct DirectBase : T {
    virtual void foo();
  };
  
  DirectBase<Foo> Y; // This instantiation should not warn about the above declaration.
  
  template<typename T>
  struct Bar {
    virtual void bar();
  };
  
  template <typename T>
  struct TemplateBase : Bar<T> {
    virtual void bar();
  };
  
  TemplateBase<int> Y; // This instantiation should warn about the above declaration.
                       // Or potentially configurable to either warn or ignore this case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147924



More information about the cfe-commits mailing list