[PATCH] D70425: [APFloat] Prevent construction of APFloat with Semantics and FP value

Ehud Katz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 10:34:02 PST 2019


ekatz updated this revision to Diff 230099.
ekatz retitled this revision from "[APFloat] Fix construction of APFloat with FP value instead of integer" to "[APFloat] Prevent construction of APFloat with Semantics and FP value".
ekatz edited the summary of this revision.
ekatz added a comment.
Herald added a subscriber: hiraditya.

Added a new constructor overload, which accepts any FP value and marked with `delete`, to prevent its usage.

This must be done with SFINAE, otherwise (a simple overload for `double`/`float`) we get "ambiguous call to overloaded function", unless we overload each specific type we allow (not only `integerPart`).


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

https://reviews.llvm.org/D70425

Files:
  llvm/include/llvm/ADT/APFloat.h
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/unittests/ADT/APFloatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70425.230099.patch
Type: text/x-patch
Size: 5537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191119/91ebd2ee/attachment.bin>


More information about the llvm-commits mailing list