Issue 130229
Summary clang optimization ignores UB (overflow) + standard library bug
Labels
Assignees
Reporter kelbon
    https://godbolt.org/z/r8Yd7nhzc

Not sure standard requires this behavior or not, but it is undefined behavior in IMPLICI T conversion, in naive code, which is expected to be working. Huge disappointmentin in std::chrono

```cpp
#include <chrono>
#include <iostream>
int main() {
    std::chrono::nanoseconds ns = std::chrono::milliseconds::max();
    std::cout << ns.count() << "|" << ns.max().count();
}
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to