disable this chunk of loplugin code on clang < 3.8
not worth the spaghetti of making it work across version Change-Id: I0de923b16fb6d58cbad55adc9878ab39bc0c86ae
This commit is contained in:
parent
458a9fd806
commit
5e997f4dba
@ -222,13 +222,12 @@ const CXXMethodDecl* UnnecessaryOverride::findOverriddenOrSimilarMethodInSupercl
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CLANG_VERSION < 30800
|
||||||
|
return nullptr;
|
||||||
|
#else
|
||||||
std::vector<const CXXMethodDecl*> maSimilarMethods;
|
std::vector<const CXXMethodDecl*> maSimilarMethods;
|
||||||
|
|
||||||
#if CLANG_VERSION >= 30800
|
|
||||||
auto BaseMatchesCallback = [&](const CXXBaseSpecifier *cxxBaseSpecifier, CXXBasePath& )
|
auto BaseMatchesCallback = [&](const CXXBaseSpecifier *cxxBaseSpecifier, CXXBasePath& )
|
||||||
#else
|
|
||||||
auto BaseMatchesCallback = [&](const CXXBaseSpecifier *cxxBaseSpecifier, CXXBasePath&, void* )
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (cxxBaseSpecifier->getAccessSpecifier() != AS_public && cxxBaseSpecifier->getAccessSpecifier() != AS_protected)
|
if (cxxBaseSpecifier->getAccessSpecifier() != AS_public && cxxBaseSpecifier->getAccessSpecifier() != AS_protected)
|
||||||
return false;
|
return false;
|
||||||
@ -269,16 +268,13 @@ const CXXMethodDecl* UnnecessaryOverride::findOverriddenOrSimilarMethodInSupercl
|
|||||||
};
|
};
|
||||||
|
|
||||||
CXXBasePaths aPaths;
|
CXXBasePaths aPaths;
|
||||||
#if CLANG_VERSION >= 30800
|
|
||||||
methodDecl->getParent()->lookupInBases(BaseMatchesCallback, aPaths);
|
methodDecl->getParent()->lookupInBases(BaseMatchesCallback, aPaths);
|
||||||
#else
|
|
||||||
methodDecl->getParent()->lookupInBases(BaseMatchesCallback, nullptr, aPaths);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (maSimilarMethods.size() == 1) {
|
if (maSimilarMethods.size() == 1) {
|
||||||
return maSimilarMethods[0];
|
return maSimilarMethods[0];
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user