diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-02 11:33:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-02 13:15:33 +0100 |
commit | a0e136d2cbb3784ddfcbddcfed5d784c8e4c9a64 (patch) | |
tree | a86891188892c9525679a4a2a47ab772e7ccecbc /compilerplugins/clang/passstuffbyref.cxx | |
parent | 4855257e52056241633c2b1d8159c3f0e71e05f3 (diff) |
loplugin:passstuffbyref improved return in sd,various
Change-Id: I4b6ea89ae2072f4389a696ea3c96d8f7a5731e7a
Reviewed-on: https://gerrit.libreoffice.org/47246
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/passstuffbyref.cxx')
-rw-r--r-- | compilerplugins/clang/passstuffbyref.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx index aca8b89da5a3..54982fdfc045 100644 --- a/compilerplugins/clang/passstuffbyref.cxx +++ b/compilerplugins/clang/passstuffbyref.cxx @@ -380,6 +380,10 @@ bool PassStuffByRef::isReturnExprDisqualified(const Expr* expr) return isReturnExprDisqualified(condOper->getTrueExpr()) || isReturnExprDisqualified(condOper->getFalseExpr()); } + if (auto unaryOp = dyn_cast<UnaryOperator>(expr)) { + expr = unaryOp->getSubExpr(); + continue; + } if (auto operatorCallExpr = dyn_cast<CXXOperatorCallExpr>(expr)) { // TODO could improve this, but sometimes it means we're returning a copy of a temporary. // Same logic as CXXOperatorCallExpr::isAssignmentOp(), which our supported clang |