[PATCH] D42728: Add more warnings for implict conversions (e.g. double truncation to float).

Andrew V. Tischenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 03:19:43 PST 2018


avt77 added a comment.

In https://reviews.llvm.org/D42728#1016362, @rjmccall wrote:

> The diagnostic text for this warning is misleading at best when the conversion is actually a truncation of the result of a compound assignment.


OK, at the moment we have:

*b += a; // expected-warning {{implicit conversion loses floating-point precision: 'double' to 'float'}}

But you'd like to see something like:

*b += a; // expected-warning {{truncation of the result of a compound assignment loses floating-point precision: 'double' to 'float'}}

Right? And you'd like to keep the current message at simple assignment, right?


https://reviews.llvm.org/D42728





More information about the llvm-commits mailing list