summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/passstuffbyref.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins/clang/passstuffbyref.cxx')
-rw-r--r--compilerplugins/clang/passstuffbyref.cxx4
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