compilerplugins/clang/constparams.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 5d2e830a309dbc5186b2b6e35ecacf533ff7da0c
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Wed Aug 30 15:14:19 2017 +0200

    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

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;
             }
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to