summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-06 11:58:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-06 11:41:46 +0000
commitf1945405b08cad5138345882cb68c64edeeabdae (patch)
treef0622d2970097e7e80050fcb19559844563334e1 /compilerplugins
parent0840bc7957117b8913e3d7d5848bbc4524b4949e (diff)
loplugin:redundantcast check for c-style float casts
Change-Id: I86b6f58887cb398a80698f8d8564b5bc3f55eabb Reviewed-on: https://gerrit.libreoffice.org/36198 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/redundantcast.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/compilerplugins/clang/redundantcast.cxx b/compilerplugins/clang/redundantcast.cxx
index 845876425c7e..59e21657f548 100644
--- a/compilerplugins/clang/redundantcast.cxx
+++ b/compilerplugins/clang/redundantcast.cxx
@@ -306,7 +306,8 @@ bool RedundantCast::VisitCStyleCastExpr(CStyleCastExpr const * expr) {
<< t1 << t2 << expr->getSourceRange();
return true;
}
- bool bBuiltinType = t1->isSpecificBuiltinType(BuiltinType::Bool) || t1->isSpecificBuiltinType(BuiltinType::Double);
+ bool bBuiltinType = t1->isSpecificBuiltinType(BuiltinType::Bool) || t1->isSpecificBuiltinType(BuiltinType::Double)
+ || t1->isSpecificBuiltinType(BuiltinType::Float);
if ((bBuiltinType || loplugin::TypeCheck(t1).Typedef()) && t1 == t2)
{
// Ignore FD_ISSET expanding to "...(SOCKET)(fd)..." in some Microsoft