summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/passstuffbyref.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-12-16 15:14:23 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-12-16 15:14:23 +0100
commitb998313d9d1ec511eff5076029e62608c8c5ca0e (patch)
treecf1e533c8dc81fef15848998b2cd06e0c7f1f022 /compilerplugins/clang/passstuffbyref.cxx
parentbfcecd677434a253b326bfe31d87b1a0958c8cea (diff)
Make move detection in loplugin:passstuffbyref work with MSVCRT
...where an ImplicitCastExpr happens to appear between CXXConstructExpr and CallExpr Change-Id: I62226cc89d87bd3d9c03743b650f10c32c18f9be
Diffstat (limited to 'compilerplugins/clang/passstuffbyref.cxx')
-rw-r--r--compilerplugins/clang/passstuffbyref.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index 8695ae62d622..fca6b7375a07 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -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;