Kaydet (Commit) 3adaad3e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast: Warn about more of the potentially suspicious ones

Change-Id: Id7a596344c21e9265e35188c477e60ce510bcc6e
üst e6c124ae
......@@ -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()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment