Enable warn_impcast_literal_float_to_integer by default.
This diagnostic seems to be production ready, it's just an oversight that it
wasn't turned on by default.
The test changes are a bit of a mixed bag. Some tests that seemed like they
clearly didn't need to use this behavior have been modified not to use it.
Others that I couldn't be sure about, I added the necessary expected-warnings
to.
It's possible the diagnostic message could be improved to make it clearer that
this warning can be suppressed by using a value that won't lose precision when
converted to the target type (but can still be a floating point literal, such
as "bool b = 1.0;").
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154068 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/warn-thread-safety-analysis.cpp b/test/SemaCXX/warn-thread-safety-analysis.cpp
index 715645c..566e5c1 100644
--- a/test/SemaCXX/warn-thread-safety-analysis.cpp
+++ b/test/SemaCXX/warn-thread-safety-analysis.cpp
@@ -1153,7 +1153,7 @@
int Foo::foo()
{
int res;
- w = 5.2;
+ w = 5;
res = a_ + 5;
return res;
}
@@ -1167,7 +1167,7 @@
mu_.Unlock();
if (x > 5) {
mu1.Lock();
- g = 2.3;
+ g = 2;
mu1.Unlock();
}
}
@@ -1185,7 +1185,7 @@
f2->bar(); // expected-warning {{cannot call function 'bar' while mutex 'mu_' is locked}}
f2->mu_.Unlock();
mu2.Lock();
- w = 2.5;
+ w = 2;
mu2.Unlock();
}
} // end namespace thread_annot_lock_13