diff options
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 18 | ||||
-rw-r--r-- | test/Sema/conversion-64-32.c | 20 |
2 files changed, 4 insertions, 34 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 5e8770888c..4b507f456c 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -3699,24 +3699,15 @@ static void AnalyzeAssignment(Sema &S, BinaryOperator *E) { /// Diagnose an implicit cast; purely a helper for CheckImplicitConversion. static void DiagnoseImpCast(Sema &S, Expr *E, QualType SourceType, QualType T, - SourceLocation CContext, unsigned diag, - bool pruneControlFlow = false) { - if (pruneControlFlow) { - S.DiagRuntimeBehavior(E->getExprLoc(), E, - S.PDiag(diag) - << SourceType << T << E->getSourceRange() - << SourceRange(CContext)); - return; - } + SourceLocation CContext, unsigned diag) { S.Diag(E->getExprLoc(), diag) << SourceType << T << E->getSourceRange() << SourceRange(CContext); } /// Diagnose an implicit cast; purely a helper for CheckImplicitConversion. static void DiagnoseImpCast(Sema &S, Expr *E, QualType T, - SourceLocation CContext, unsigned diag, - bool pruneControlFlow = false) { - DiagnoseImpCast(S, E, E->getType(), T, CContext, diag, pruneControlFlow); + SourceLocation CContext, unsigned diag) { + DiagnoseImpCast(S, E, E->getType(), T, CContext, diag); } /// Diagnose an implicit cast from a literal expression. Does not warn when the @@ -3922,8 +3913,7 @@ void CheckImplicitConversion(Sema &S, Expr *E, QualType T, return; if (SourceRange.Width == 64 && TargetRange.Width == 32) - return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_integer_64_32, - /* pruneControlFlow */ true); + return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_integer_64_32); return DiagnoseImpCast(S, E, T, CC, diag::warn_impcast_integer_precision); } diff --git a/test/Sema/conversion-64-32.c b/test/Sema/conversion-64-32.c index 62db7dcd2e..112e995102 100644 --- a/test/Sema/conversion-64-32.c +++ b/test/Sema/conversion-64-32.c @@ -13,23 +13,3 @@ int4 test1(long2 a) { int4 v127 = a; // no warning. return v127; } - -// <rdar://problem/10759934> -// Don't warn about -Wshorten-64-to-32 in unreachable code. -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; -int rdar10759934() { - uint32_t thing = 0; - uint64_t thing2 = 0; - - switch (sizeof(thing2)) { - case 8: - break; - case 4: - thing = thing2; // no-warning - default: - break; - } - - return 0; -} |