aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-03-01 03:29:37 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-03-01 03:29:37 +0000
commite34e3f16580c586b032035e2612d12ae4569f21e (patch)
tree66e52bc4b1a48492ff6cc8f703ef2926fba924af /lib/Sema/SemaOverload.cpp
parent3c0349e87cdbd7316d06d2411d86ee1086e717a5 (diff)
Move the bool-conversions behind the DiagRuntimeBehavior logic. It's
possible for these to show up due to metaprogramming both in unevaluated contexts and compile-time dead branches. Those aren't the bugs we're looking for. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index f5316b564e..14d545d3e4 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1939,8 +1939,8 @@ bool Sema::CheckPointerConversion(Expr *From, QualType ToType,
if (CXXBoolLiteralExpr* LitBool
= dyn_cast<CXXBoolLiteralExpr>(From->IgnoreParens()))
if (!IsCStyleOrFunctionalCast && LitBool->getValue() == false)
- Diag(LitBool->getExprLoc(), diag::warn_init_pointer_from_false)
- << ToType;
+ DiagRuntimeBehavior(LitBool->getExprLoc(), From,
+ PDiag(diag::warn_init_pointer_from_false) << ToType);
if (const PointerType *FromPtrType = FromType->getAs<PointerType>())
if (const PointerType *ToPtrType = ToType->getAs<PointerType>()) {