I'm not sure what to do with the float case here, maybe it's not relevant at all.
Details
Details
Diff Detail
Diff Detail
Event Timeline
| clang/lib/AST/Interp/Interp.h | ||
|---|---|---|
| 438–441 | 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. | |
| clang/lib/AST/Interp/Interp.h | ||
|---|---|---|
| 438–441 | 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. | |
| clang/lib/AST/Interp/Interp.h | ||
|---|---|---|
| 438–441 | I think we should probably assert that the failure only occurs for integer types and not other arithmetic types. | |
Comment Actions
LGTM with a request to add a message to the assertion.
| clang/lib/AST/Interp/Interp.h | ||
|---|---|---|
| 441 | ||
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.