[PATCH] D148987: [clang][Interp] Check Neg ops for errors
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 25 09:35:12 PDT 2023
aaron.ballman 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.
+
----------------
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`.
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