[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:19:33 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}}
----------------
xbolva00 wrote:
> lebedev.ri wrote:
> > 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.
> yeah :/ so maybe integer precision?
It's still rather a bit too vague i'd say.
It should describe what you actually checked.


https://reviews.llvm.org/D52835





More information about the cfe-commits mailing list