[clang-tidy] Fix ParentVirtualCallCheck for old MSVS compilers

llvm-svn: 329999
This commit is contained in:
Zinovy Nis 2018-04-13 08:43:47 +00:00
parent f6b29caa5b
commit 258d607b9f
1 changed files with 2 additions and 1 deletions

View File

@ -28,11 +28,12 @@ static bool isParentOf(const CXXRecordDecl &Parent,
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();
});
}