ziangwan marked 6 inline comments as done.
ziangwan added inline comments.

================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:3245
+def warn_impcast_integer_float_precision : Warning<
+  "implicit conversion from %0 to %1 may loses integer precision">,
+  InGroup<ImplicitFloatConversion>, DefaultIgnore;
----------------
nickdesaulniers wrote:
> `may lose` or just `loses`.
"may lose". Whether the precision loss really happens depends on the value of i 
(how many precision bits i has).

For example, `float e = i` where i is an integer. If i is 15 then there isn't 
precision loss. If i is 222222222, then there is precision loss.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:11417
+    llvm::APFloat SourceToFloatValue(
+      S.Context.getFloatTypeSemantics(QualType(TargetBT, 0)));
+
----------------
nickdesaulniers wrote:
> should this use `SourceBT` rather than `TargetBT`?
Should be `TargetBT`. I've updated the naming convention to make it more clear.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64666/new/

https://reviews.llvm.org/D64666



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to