[clang-tools-extra] r329999 - [clang-tidy] Fix ParentVirtualCallCheck for old MSVS compilers

Zinovy Nis via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 13 01:43:47 PDT 2018


Author: zinovy.nis
Date: Fri Apr 13 01:43:47 2018
New Revision: 329999

URL: http://llvm.org/viewvc/llvm-project?rev=329999&view=rev
Log:
[clang-tidy] Fix ParentVirtualCallCheck for old MSVS compilers


Modified:
    clang-tools-extra/trunk/clang-tidy/bugprone/ParentVirtualCallCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/bugprone/ParentVirtualCallCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/ParentVirtualCallCheck.cpp?rev=329999&r1=329998&r2=329999&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/ParentVirtualCallCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/ParentVirtualCallCheck.cpp Fri Apr 13 01:43:47 2018
@@ -28,11 +28,12 @@ static bool isParentOf(const CXXRecordDe
                        const CXXRecordDecl &ThisClass) {
   if (Parent.getCanonicalDecl() == ThisClass.getCanonicalDecl())
     return true;
+  const CXXRecordDecl *ParentCanonicalDecl = Parent.getCanonicalDecl();
   return ThisClass.bases_end() !=
          llvm::find_if(ThisClass.bases(), [=](const CXXBaseSpecifier &Base) {
            auto *BaseDecl = Base.getType()->getAsCXXRecordDecl();
            assert(BaseDecl);
-           return Parent.getCanonicalDecl() == BaseDecl->getCanonicalDecl();
+           return ParentCanonicalDecl == BaseDecl->getCanonicalDecl();
          });
 }
 




More information about the cfe-commits mailing list