diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-10-22 02:37:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-10-22 02:37:33 +0000 |
commit | 5e745da03df27ac620b0a5cc280d0d1757cfbac1 (patch) | |
tree | e2bb736fb561d8924f26f14db99a3faba5365065 /lib/Sema/SemaChecking.cpp | |
parent | 439ed1656664b29841f70b6c0b91460534ff4d93 (diff) |
Only emit implicit constant conversion truncation warnings in reachable code. Apparently this is what GCC does, and some code depends on this. Fixes <rdar://problem/10321089>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142716 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index f080a618b7..daab1cd487 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -3536,9 +3536,11 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T, std::string PrettySourceValue = Value.toString(10); std::string PrettyTargetValue = PrettyPrintInRange(Value, TargetRange); - S.Diag(E->getExprLoc(), diag::warn_impcast_integer_precision_constant) - << PrettySourceValue << PrettyTargetValue - << E->getType() << T << E->getSourceRange() << clang::SourceRange(CC); + S.DiagRuntimeBehavior(E->getExprLoc(), E, + S.PDiag(diag::warn_impcast_integer_precision_constant) + << PrettySourceValue << PrettyTargetValue + << E->getType() << T << E->getSourceRange() + << clang::SourceRange(CC)); return; } |