| Issue |
168778
|
| Summary |
Missing warnings for UB float to unsigned cast
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Alcaro
|
```c
// Type your code here, or load an example.
unsigned square() { return -1.0; }
unsigned cube() { return (unsigned)-1.0; }
unsigned tesseract() { double num = -1.0; return num; }
```
Expected: All three compile to a single `ret` with -O2 (https://godbolt.org/z/bYjovz9nM), so I would quite like to see three warnings.
Actual: Only the first one warns.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs