[PATCH] D44295: [clang-tidy] Detects and fixes calls to grand-...parent virtual methods instead of calls to parent's virtual methods

Zinovy Nis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 1 07:35:37 PDT 2018


zinovy.nis updated this revision to Diff 140579.
zinovy.nis added a comment.

- Minor cosmetic fix: use lexical representation instead of semanic for printing callee string. It helps to print class names hidden behind 'typedef' and 'using':



  using A1 = A;
  typedef A A2;
  
  class C2 : public B {
  public:
    int virt_1() override { return A1::virt_1() + A2::virt_1(); }
    // BEFORE: warning: qualified name 'A::virt_1'...
    // BEFORE: warning: qualified name 'A::virt_1'...
  
    //  AFTER: warning: qualified name 'A1::virt_1'...
    //  AFTER: warning: qualified name 'A2::virt_1'...
  };


https://reviews.llvm.org/D44295

Files:
  clang-tidy/bugprone/BugproneTidyModule.cpp
  clang-tidy/bugprone/CMakeLists.txt
  clang-tidy/bugprone/ParentVirtualCallCheck.cpp
  clang-tidy/bugprone/ParentVirtualCallCheck.h
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/bugprone-parent-virtual-call.rst
  docs/clang-tidy/checks/list.rst
  test/clang-tidy/bugprone-parent-virtual-call.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44295.140579.patch
Type: text/x-patch
Size: 17911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180401/7a182657/attachment-0001.bin>


More information about the cfe-commits mailing list