Make move detection in loplugin:passstuffbyref work with MSVCRT

...where an ImplicitCastExpr happens to appear between CXXConstructExpr and
CallExpr

Change-Id: I62226cc89d87bd3d9c03743b650f10c32c18f9be
This commit is contained in:
Stephan Bergmann 2016-12-16 15:14:23 +01:00
parent bfcecd6774
commit b998313d9d

View File

@ -204,7 +204,7 @@ void PassStuffByRef::checkParams(const FunctionDecl * functionDecl) {
auto cxxConstructExpr = dyn_cast<CXXConstructExpr>(cxxCtorInitializer->getInit());
if (cxxConstructExpr && cxxConstructExpr->getNumArgs() == 1)
{
if (auto callExpr = dyn_cast<CallExpr>(cxxConstructExpr->getArg(0))) {
if (auto callExpr = dyn_cast<CallExpr>(cxxConstructExpr->getArg(0)->IgnoreParenImpCasts())) {
if (loplugin::DeclCheck(callExpr->getCalleeDecl()).Function("move").StdNamespace()) {
bFoundMove = true;
break;