0

Is there a clang-tidy check for replacing A::bar(); with just bar(); in the following example?

class A {
  void bar() {
  };
  void foo() {
    A::bar();
  };
};
Curious
  • 2,783
  • 3
  • 29
  • 45
  • Have you referred to the [list of available checks](https://clang.llvm.org/extra/clang-tidy/checks/list.html)? I kind of doubt that this specific check would exist. I can't say I've ever seen a class name redundantly specified without a good reason (like disambiguation) – Human-Compiler Dec 01 '20 at 15:22
  • Are you asking for a way to force the compiler (in your case CLang) to raise a warning if someone is using that code-style? (hence for your comrade to remove it before commit) – Stefano Buora Dec 01 '20 at 15:30
  • @Human-Compiler I couldn't find one in the list of clang-tidy check. I was thinking a lintiing tool like clang-tidy should be able to do is. – Curious Dec 01 '20 at 18:18

0 Answers0