diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-22 08:13:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-22 08:13:42 +0100 |
commit | 3adaad3e36d0adc444f1085fceb7f4e5b43cfeef (patch) | |
tree | 1839d0767b2114253eb555a87e6b379b7367f9e4 /compilerplugins/clang/cstylecast.cxx | |
parent | e6c124ae3b4de78848344a172003de934e1cb163 (diff) |
loplugin:cstylecast: Warn about more of the potentially suspicious ones
Change-Id: Id7a596344c21e9265e35188c477e60ce510bcc6e
Diffstat (limited to 'compilerplugins/clang/cstylecast.cxx')
-rw-r--r-- | compilerplugins/clang/cstylecast.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
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()) { |