summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/VirtualNearMissCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/VirtualNearMissCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/VirtualNearMissCheck.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/VirtualNearMissCheck.cpp b/clang-tools-extra/clang-tidy/misc/VirtualNearMissCheck.cpp
index ba4655b16a8..d43ddfbac76 100644
--- a/clang-tools-extra/clang-tidy/misc/VirtualNearMissCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/VirtualNearMissCheck.cpp
@@ -178,7 +178,8 @@ bool VirtualNearMissCheck::isPossibleToBeOverridden(
bool IsPossible = !BaseMD->isImplicit() && !isa<CXXConstructorDecl>(BaseMD) &&
!isa<CXXDestructorDecl>(BaseMD) && BaseMD->isVirtual() &&
- !BaseMD->isOverloadedOperator();
+ !BaseMD->isOverloadedOperator() &&
+ !isa<CXXConversionDecl>(BaseMD);
PossibleMap[Id] = IsPossible;
return IsPossible;
}
@@ -210,8 +211,9 @@ void VirtualNearMissCheck::registerMatchers(MatchFinder *Finder) {
return;
Finder->addMatcher(
- cxxMethodDecl(unless(anyOf(isOverride(), isImplicit(),
- cxxConstructorDecl(), cxxDestructorDecl())))
+ cxxMethodDecl(
+ unless(anyOf(isOverride(), isImplicit(), cxxConstructorDecl(),
+ cxxDestructorDecl(), cxxConversionDecl())))
.bind("method"),
this);
}
OpenPOWER on IntegriCloud