From ef44d45a4e23ee58b245563222d18bc18300c3d1 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 28 Mar 2015 19:08:56 +0100 Subject: Clean up C-style casts from pointers to void Change-Id: Idff46e5642034cf751d557de9a49c02a7abf27bb --- compilerplugins/clang/cstylecast.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'compilerplugins') diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx index 048d2d59cd87..fcc1fc828862 100644 --- a/compilerplugins/clang/cstylecast.cxx +++ b/compilerplugins/clang/cstylecast.cxx @@ -114,14 +114,9 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) { std::string incompFrom; std::string incompTo; if( expr->getCastKind() == CK_BitCast ) { - QualType t = resolvePointers(expr->getSubExprAsWritten()->getType()); - // Ignore "safe" casts for now that involve casting from void* (and can - // thus not be interpreted as either a static_cast or a - // reinterpret_cast, with potentially different results): - if (t->isVoidType()) { - return true; - } - if (t->isIncompleteType()) { + if (resolvePointers(expr->getSubExprAsWritten()->getType()) + ->isIncompleteType()) + { incompFrom = "incomplete "; } if (resolvePointers(expr->getType())->isIncompleteType()) { -- cgit