summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/constparams.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-03 10:23:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-03 11:06:54 +0200
commitdafae0fe31353a8092334328d499bc108d39e44c (patch)
tree7c7d58067996627f163e2f65f7faae86dd91615a /compilerplugins/clang/constparams.cxx
parenteba883c8a2ce045fc7bd3848d796ca10b7f4ba51 (diff)
loplugin:constparams in sd
Change-Id: I833c6da99d5ccb8f6a8b5c905bee73b75fde0a89 Reviewed-on: https://gerrit.libreoffice.org/40700 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/constparams.cxx')
-rw-r--r--compilerplugins/clang/constparams.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx
index 25e87630b2bb..54501dc527db 100644
--- a/compilerplugins/clang/constparams.cxx
+++ b/compilerplugins/clang/constparams.cxx
@@ -103,6 +103,8 @@ bool ConstParams::VisitFunctionDecl(const FunctionDecl * functionDecl)
if (functionDecl->getTemplatedKind() != FunctionDecl::TK_NonTemplate) {
return true;
}
+ if (functionDecl->isDeleted())
+ return true;
if (isa<CXXMethodDecl>(functionDecl)
&& dyn_cast<CXXMethodDecl>(functionDecl)->getParent()->getDescribedClassTemplate() != nullptr ) {
return true;
@@ -409,7 +411,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar
} else if (isa<CXXDependentScopeMemberExpr>(parent)) {
return false;
} else if (isa<MaterializeTemporaryExpr>(parent)) {
- return true;
+ return checkIfCanBeConst(parent, parmVarDecl);
} else if (auto conditionalExpr = dyn_cast<ConditionalOperator>(parent)) {
if (conditionalExpr->getCond() == stmt)
return true;
@@ -442,6 +444,8 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar
return checkIfCanBeConst(parent, parmVarDecl);
} else if (isa<CaseStmt>(parent)) {
return true;
+ } else if (isa<CXXPseudoDestructorExpr>(parent)) {
+ return false;
} else {
parent->dump();
parmVarDecl->dump();