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

Noel Grandin noel.grandin at collabora.co.uk
Thu Aug 17 14:20:45 UTC 2017


 compilerplugins/clang/passparamsbyref.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 19522f05880d67fda63dc6c62c0f5afb851c6a31
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Aug 17 16:18:15 2017 +0200

    fix compiler error in passparamsbyref
    
    Under clang-3.8 we get:
    
    compilerplugins/clang/passparamsbyref.cxx:158:31: error: no member named
    'isAssignmentOp' in 'clang::CXXOperatorCallExpr'
    
    Change-Id: Icfba2b624f53f07418674237adc5a47819f73c43

diff --git a/compilerplugins/clang/passparamsbyref.cxx b/compilerplugins/clang/passparamsbyref.cxx
index aa66d09ea3db..01362afc9a82 100644
--- a/compilerplugins/clang/passparamsbyref.cxx
+++ b/compilerplugins/clang/passparamsbyref.cxx
@@ -155,7 +155,12 @@ bool PassParamsByRef::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr * cxxOp
     if (!mbInsideFunctionDecl)
         return true;
     // if we are assigning to a parameter, it can be inconvenient to make the param pass-by-ref
-    if (!cxxOperatorCallExpr->isAssignmentOp())
+    auto op = cxxOperatorCallExpr->getOperator();
+    if ( op != clang::OverloadedOperatorKind::OO_Equal
+         && op != clang::OverloadedOperatorKind::OO_SlashEqual
+         && op != clang::OverloadedOperatorKind::OO_StarEqual
+         && op != clang::OverloadedOperatorKind::OO_MinusEqual
+         && op != clang::OverloadedOperatorKind::OO_PlusEqual)
         return true;
     auto declRefExpr = dyn_cast<DeclRefExpr>(cxxOperatorCallExpr->getArg(0));
     if (!declRefExpr)


More information about the Libreoffice-commits mailing list