[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Fri Dec 16 14:16:36 UTC 2016


 compilerplugins/clang/passstuffbyref.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b998313d9d1ec511eff5076029e62608c8c5ca0e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 16 15:14:23 2016 +0100

    Make move detection in loplugin:passstuffbyref work with MSVCRT
    
    ...where an ImplicitCastExpr happens to appear between CXXConstructExpr and
    CallExpr
    
    Change-Id: I62226cc89d87bd3d9c03743b650f10c32c18f9be

diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index 8695ae6..fca6b73 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;


More information about the Libreoffice-commits mailing list