aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-28 14:54:11 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-28 14:54:11 +0000
commitb3358724d985dc08889f7905f20284718361e885 (patch)
tree8dbf4dda1e6b308e9b16366a2a07337ae0713cc7 /lib/Sema/SemaOverload.cpp
parent1a18600b85aaa691122983dd8dcf4225cfc9ef68 (diff)
Don't warn with -Wbool-conversions if the user wrote an explicit cast like "(void *)false".
Fixes rdar://8459342. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index a7e5e3ae71..919aea8d02 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1728,10 +1728,11 @@ bool Sema::CheckPointerConversion(Expr *From, QualType ToType,
CXXCastPath& BasePath,
bool IgnoreBaseAccess) {
QualType FromType = From->getType();
+ bool IsCStyleOrFunctionalCast = IgnoreBaseAccess;
if (CXXBoolLiteralExpr* LitBool
= dyn_cast<CXXBoolLiteralExpr>(From->IgnoreParens()))
- if (LitBool->getValue() == false)
+ if (!IsCStyleOrFunctionalCast && LitBool->getValue() == false)
Diag(LitBool->getExprLoc(), diag::warn_init_pointer_from_false)
<< ToType;