diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-28 13:50:17 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-28 13:50:37 +0100 |
commit | 4e3da621fe26c2ad85258692c63a044d0541bd64 (patch) | |
tree | 05607d0de471c5d9451b197945243f735ee168b0 /compilerplugins | |
parent | 4b60941b60262be4861f5e8fba95366d3187c445 (diff) |
Some more loplugin:cstylecast clean-up
Change-Id: I132d22e2af3cf673c17d8964f690d48990834884
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/cstylecast.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/compilerplugins/clang/cstylecast.cxx b/compilerplugins/clang/cstylecast.cxx index b8f3b5b8363c..b6bb453127c0 100644 --- a/compilerplugins/clang/cstylecast.cxx +++ b/compilerplugins/clang/cstylecast.cxx @@ -96,18 +96,17 @@ bool CStyleCast::VisitCStyleCastExpr(const CStyleCastExpr * expr) { std::string incompFrom; std::string incompTo; if( expr->getCastKind() == CK_BitCast ) { - QualType t1 = resolvePointers(expr->getSubExprAsWritten()->getType()); - QualType t2 = resolvePointers(expr->getType()); - // 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 + 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 (t1->isVoidType() || t2->isVoidType()) { + if (t->isVoidType()) { return true; } - if (t1->isIncompleteType()) { + if (t->isIncompleteType()) { incompFrom = "incomplete "; } - if (t2->isIncompleteType()) { + if (resolvePointers(expr->getType())->isIncompleteType()) { incompTo = "incomplete "; } } |