diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-08-30 15:14:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-08-30 15:14:19 +0200 |
commit | 5d2e830a309dbc5186b2b6e35ecacf533ff7da0c (patch) | |
tree | cb22c4c36efa62fc49e299acfbf38a86ca17c3f2 /compilerplugins/clang | |
parent | 0660a30d54eb6762302cf1afd43de01e137f6393 (diff) |
Avoid loplugin:constparam when param is cast to void
...which typically indicates that the param just has to be of the given type for
some reason
Change-Id: Ide30f514c5a849ae897c31c1744ece9df712a9fc
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/constparams.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compilerplugins/clang/constparams.cxx b/compilerplugins/clang/constparams.cxx index 31c1bc29affa..2a1fc1ff8a2d 100644 --- a/compilerplugins/clang/constparams.cxx +++ b/compilerplugins/clang/constparams.cxx @@ -187,8 +187,6 @@ bool ConstParams::VisitFunctionDecl(const FunctionDecl * functionDecl) || name == "egiGraphicExport" || name == "etiGraphicExport" || name == "epsGraphicExport" - || name == "QueueCallbackFunction" - // apple_remote/source/HIDRemoteControlDevice.m ) return true; } @@ -419,8 +417,8 @@ 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)) { - if (loplugin::TypeCheck(e->getTypeAsWritten()).Pointer().NonConst()) - { + loplugin::TypeCheck tc(e->getTypeAsWritten()); + if (tc.Pointer().NonConst() || tc.Void()) { return false; } } |