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.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx
index f87e668ed4fa..3b4b974c697f 100644
--- a/compilerplugins/clang/passstuffbyref.cxx
+++ b/compilerplugins/clang/passstuffbyref.cxx
@@ -310,8 +310,11 @@ bool PassStuffByRef::isReturnExprDisqualified(const Expr* expr)
if (isa<ExprWithCleanups>(expr)) {
return true;
}
- if (const CXXConstructExpr* constructExpr = dyn_cast<CXXConstructExpr>(expr)) {
- if (constructExpr->getNumArgs()==1) {
+ if (const CXXConstructExpr* constructExpr = dyn_cast<CXXConstructExpr>(expr))
+ {
+ if (constructExpr->getNumArgs()==1
+ && constructExpr->getConstructor()->isCopyOrMoveConstructor())
+ {
expr = constructExpr->getArg(0)->IgnoreParenCasts();
}
}