Some more loplugin:cstylecast clean-up

Change-Id: I132d22e2af3cf673c17d8964f690d48990834884
This commit is contained in:
Stephan Bergmann
2015-01-28 13:50:17 +01:00
parent 4b60941b60
commit 4e3da621fe
25 changed files with 86 additions and 75 deletions

View File

@@ -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 ";
}
}