[PATCH] D52835: [Diagnostics] Check integer to floating point number implicit conversions

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 11:16:49 PDT 2018


lebedev.ri added inline comments.


================
Comment at: test/Sema/ext_vector_casts.c:121
   vf = d + vf; // expected-warning {{implicit conversion loses floating-point precision}}
-  vf = vf + 0xffffffff;
+  vf = vf + 0xffffffff; // expected-warning {{implicit conversion loses floating-point precision: 'unsigned int' to 'float2' (vector of 2 'float' values)}}
   vf = vf + 2.1; // expected-warning {{implicit conversion loses floating-point precision}}
----------------
How is floating-point precision is being lost if the cast is from an integer?
I'm guessing you want to add a new diag with a more appropriate description.


https://reviews.llvm.org/D52835





More information about the cfe-commits mailing list