[PATCH] D64666: [Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss

Steve Canon via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 15 10:50:30 PDT 2019


scanon requested changes to this revision.
scanon added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:11429
+          S.Context.getFloatTypeSemantics(QualType(TargetBT, 0)));
+        TargetFloatValue.convertFromAPInt(SourceInt,
+          SourceBT->isSignedInteger(), llvm::APFloat::rmNearestTiesToEven);
----------------
Why don't we just check that the result of the first conversion is opOK? I don't think doing a round-trip check is required here.


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

https://reviews.llvm.org/D64666





More information about the cfe-commits mailing list