summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-11 17:53:22 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-02-11 17:53:22 +0000
commit77ed8972fa29d8ec2ea14dafec25e5e02c021e37 (patch)
treeb7dba72693590379319fce88674421528030e7e4 /clang/lib/AST/Expr.cpp
parentf07582499884523cd47414e2fde8fe7dae09f74d (diff)
downloadbcm5719-llvm-77ed8972fa29d8ec2ea14dafec25e5e02c021e37.tar.gz
bcm5719-llvm-77ed8972fa29d8ec2ea14dafec25e5e02c021e37.zip
[Sema] Revert the change in r200622 that allowed integer casts to silence -Wnon-literal-null-conversion in C code.
It is actually useful to warn in such cases, thanks to Dmitri for pushing on this and making us see the light! Related to rdar://15925483 and rdar://15922612. The latter radar is where the usefulness of the warning is most clear. llvm-svn: 201165
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r--clang/lib/AST/Expr.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index 649f3580bdd..3f5833c5015 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -3061,9 +3061,6 @@ Expr::isNullPointerConstant(ASTContext &Ctx,
Pointee->isVoidType() && // to void*
CE->getSubExpr()->getType()->isIntegerType()) // from int.
return CE->getSubExpr()->isNullPointerConstant(Ctx, NPC);
- // Or an integer cast.
- } else if (CE->getType()->isIntegerType()) {
- return CE->getSubExpr()->isNullPointerConstant(Ctx, NPC);
}
}
} else if (const ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(this)) {
OpenPOWER on IntegriCloud