summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-10-22 02:37:33 +0000
committerTed Kremenek <kremenek@apple.com>2011-10-22 02:37:33 +0000
commit33ba99566f56cf09fd0c3a1ca26522aa9ce6553c (patch)
tree30d74a0af61072d4a64d0e9c2b5b3ead482f5990 /clang/lib/Sema/SemaChecking.cpp
parenta98d106d498de8bae8d27d3642a991e1ce0b6406 (diff)
downloadbcm5719-llvm-33ba99566f56cf09fd0c3a1ca26522aa9ce6553c.tar.gz
bcm5719-llvm-33ba99566f56cf09fd0c3a1ca26522aa9ce6553c.zip
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>.
llvm-svn: 142716
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index f080a618b7a..daab1cd4877 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud