Issue 140980
Summary UB when converting a float-point value to a type that can't represent it's value
Labels clang:frontend
Assignees
Reporter shafik
    clang used to flag this as undefined behavior:

```cpp
#include <limits>

void foo() {
 constexpr double d2 = std::numeric_limits<double>::max(); 
 constexpr float f = d2;
}
```

back in clang-8 but it has not since: https://godbolt.org/z/5K1da874d

Based on [conv.double p1](https://timsong-cpp.github.io/cppwp/n4659/conv.double#1) I think this is still UB.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to