[PATCH] D148987: [clang][Interp] Check Neg ops for errors

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 25 10:25:52 PDT 2023


tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/Interp.h:438-441
+  // FIXME: This code Just Works[tm] for floats, but it's probably not doing
+  //   the right thing. At least the diagnostic could be better without
+  //   the conversion to an APInt.
+
----------------
aaron.ballman wrote:
> I'm confused -- why would negation be UB for a floating-point type? For integer types, it's a matter of not being able to represent the value when the source is `INT_MIN`.
No idea, this was just something that came to mind when I wrote the code. If it's not an issue, that's even better can I can just remove the comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148987



More information about the cfe-commits mailing list