QualType T = CastE->getType();
- // Check for redundant casts.
- if (E->getType() == T ||
+ // Check for redundant casts or casting to "void"
+ if (T->isVoidType() ||
+ E->getType() == T ||
(T->isPointerType() && E->getType()->isFunctionType())) {
Dst.Add(Pred);
return;
case Stmt::ImplicitCastExprClass: {
ImplicitCastExpr* C = cast<ImplicitCastExpr>(E);
QualType CT = C->getType();
+
+ if (CT->isVoidType())
+ return UnknownVal();
+
QualType ST = C->getSubExpr()->getType();
if (CT == ST || (CT->isPointerType() && ST->isFunctionType())) {
QualType CT = C->getType();
QualType ST = C->getSubExpr()->getType();
+ if (CT->isVoidType())
+ return UnknownVal();
+
if (CT == ST || (CT->isPointerType() && ST->isFunctionType())) {
E = C->getSubExpr();
continue;