summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-08-31 17:55:52 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-08-31 17:55:52 +0200
commit36910b444cee523766fb812ec85ad8f2b5096680 (patch)
tree08e84cd380694bb01f2030ff1c435438702b75c1 /compilerplugins
parent1897812ed4ab11409de8a58a75c3b631332ba92d (diff)
Revert loplugin:constparam behavior when param is subject of cast
...cf. 72cfd4d024aa9deb68010824a804f252e37b8388 "loplugin:constparams: Also handle ObjCObjectPointerType" Change-Id: Ieec294d721002cac0c37bf2590a9ce20b3e123e3
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/constparams.cxx9
1 files changed, 2 insertions, 7 deletions
diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx
index 50e1c98bfc3c..024c4d8e3430 100644
--- a/compilerplugins/clang/constparams.cxx
+++ b/compilerplugins/clang/constparams.cxx
@@ -188,6 +188,7 @@ bool ConstParams::VisitFunctionDecl(const FunctionDecl * functionDecl)
|| name == "egiGraphicExport"
|| name == "etiGraphicExport"
|| name == "epsGraphicExport"
+ || name == "releasePool" // vcl/osx/saldata.cxx
)
return true;
}
@@ -422,13 +423,7 @@ bool ConstParams::checkIfCanBeConst(const Stmt* stmt, const ParmVarDecl* parmVar
return false;
} else if (isa<CastExpr>(parent)) { // all other cast expression subtypes
if (auto e = dyn_cast<ExplicitCastExpr>(parent)) {
- auto t = e->getTypeAsWritten();
- if (t->isAnyPointerType()
- && !t->getPointeeType().isConstQualified())
- {
- return false;
- }
- if (loplugin::TypeCheck(t).Void()) {
+ if (loplugin::TypeCheck(e->getTypeAsWritten()).Void()) {
if (auto const sub = dyn_cast<DeclRefExpr>(
e->getSubExpr()->IgnoreParenImpCasts()))
{