aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-11-07 09:03:53 +0000
committerJohn McCall <rjmccall@apple.com>2009-11-07 09:03:53 +0000
commitdc767a1f560ae936a08eeead8164be6f82b6b0f7 (patch)
tree343f2d8e112d7fc5f54e4c56431d0697daf82089 /lib/Sema/Sema.cpp
parent6a8b7f3f62119f9d8659965ad36fa58059054c46 (diff)
Support -Wshorten-64-to-32 for integer types only, which seems to satisfy the
core requirements. Fixes rdar://problem/6389954 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 951856db71..38063ac018 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -665,6 +665,10 @@ static void CheckImplicitConversion(Sema &S, Expr *E, QualType T) {
if (IsExprValueWithinWidth(S.Context, E, TargetWidth))
return;
+ // People want to build with -Wshorten-64-to-32 and not -Wconversion
+ // and by god we'll let them.
+ if (SourceWidth == 64 && TargetWidth == 32)
+ return DiagnoseImpCast(S, E, T, diag::warn_impcast_integer_64_32);
return DiagnoseImpCast(S, E, T, diag::warn_impcast_integer_precision);
}