diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-04-05 00:16:44 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-04-05 00:16:44 +0000 |
commit | e31b8fb25b458f00e31dcd657c0840e5238e0f05 (patch) | |
tree | ac07eb4b644bd97d015c142cc12cda6ec025ac43 /test/Analysis/array-struct-region.c | |
parent | 371a0c8bd371a29af3bdebfaff5ddd075b5d7609 (diff) |
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
Diffstat (limited to 'test/Analysis/array-struct-region.c')
-rw-r--r-- | test/Analysis/array-struct-region.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Analysis/array-struct-region.c b/test/Analysis/array-struct-region.c index 1284933db0..4b085c8d70 100644 --- a/test/Analysis/array-struct-region.c +++ b/test/Analysis/array-struct-region.c @@ -25,8 +25,8 @@ int string_literal_init() { } void nested_compound_literals(int rad) { - int vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, - {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; + int vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, // expected-warning 6 {{implicit conversion turns literal floating-point number into integer}} + {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}}; // expected-warning 6 {{implicit conversion turns literal floating-point number into integer}} int a; for (a = 0; a < 6; ++a) { |