diff options
author | David Bolvansky <david.bolvansky@gmail.com> | 2018-11-14 14:24:33 +0000 |
---|---|---|
committer | David Bolvansky <david.bolvansky@gmail.com> | 2018-11-14 14:24:33 +0000 |
commit | a208bbd5769139aac84b2026aec77441bae82a08 (patch) | |
tree | 43e875043fd5cb137037065e8c47644f564a0ee9 /clang/test/Sema/ext_vector_casts.c | |
parent | 2257cbb858cf43ce73aef12a7125691001c35727 (diff) | |
download | bcm5719-llvm-a208bbd5769139aac84b2026aec77441bae82a08.tar.gz bcm5719-llvm-a208bbd5769139aac84b2026aec77441bae82a08.zip |
[Diagnostics] Check integer to floating point number implicit conversions
Summary:
GCC already catches these situations so we should handle it too.
GCC warns in C++ mode only (does anybody know why?). I think it is useful in C mode too.
Reviewers: rsmith, erichkeane, aaron.ballman, efriedma, xbolva00
Reviewed By: xbolva00
Subscribers: efriedma, craig.topper, scanon, cfe-commits
Differential Revision: https://reviews.llvm.org/D52835
llvm-svn: 346865
Diffstat (limited to 'clang/test/Sema/ext_vector_casts.c')
-rw-r--r-- | clang/test/Sema/ext_vector_casts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/ext_vector_casts.c b/clang/test/Sema/ext_vector_casts.c index 6aaedbe7fd1..cc45f3a7a2d 100644 --- a/clang/test/Sema/ext_vector_casts.c +++ b/clang/test/Sema/ext_vector_casts.c @@ -118,7 +118,7 @@ static void splats(int i, long l, __uint128_t t, float f, double d) { vf = l + vf; vf = 2.0 + vf; vf = d + vf; // expected-warning {{implicit conversion loses floating-point precision}} - vf = vf + 0xffffffff; + vf = vf + 0xffffffff; // expected-warning {{implicit conversion from 'unsigned int' to 'float2' (vector of 2 'float' values) changes value from 4294967295 to 4.2949673E+9}} vf = vf + 2.1; // expected-warning {{implicit conversion loses floating-point precision}} vd = l + vd; |