From 3adaad3e36d0adc444f1085fceb7f4e5b43cfeef Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 22 Jan 2015 08:13:20 +0100 Subject: loplugin:cstylecast: Warn about more of the potentially suspicious ones Change-Id: Id7a596344c21e9265e35188c477e60ce510bcc6e --- compilerplugins/clang/cstylecast.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'compilerplugins') diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx index 4f8bd4bfbd37..b8f3b5b8363c 100644 --- a/compilerplugins/clang/cstylecast.cxx +++ b/compilerplugins/clang/cstylecast.cxx @@ -98,12 +98,10 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) { if( expr->getCastKind() == CK_BitCast ) { QualType t1 = resolvePointers(expr->getSubExprAsWritten()->getType()); QualType t2 = resolvePointers(expr->getType()); - // Ignore "safe" casts for now that do not involve incomplete types (and - // can thus not be interpreted as either a static_cast or a + // Ignore "safe" casts for now that involve casting from or to void* + // (and can thus not be interpreted as either a static_cast or a // reinterpret_cast, with potentially different results): - if (t1->isVoidType() || t2->isVoidType() - || !(t1->isIncompleteType() || t2->isIncompleteType())) - { + if (t1->isVoidType() || t2->isVoidType()) { return true; } if (t1->isIncompleteType()) { -- cgit