diff options
author | Jordan Rupprecht <rupprecht@google.com> | 2022-02-03 12:39:45 -0800 |
---|---|---|
committer | Jordan Rupprecht <rupprecht@google.com> | 2022-02-10 08:52:17 -0800 |
commit | 99e5c5256ff2eeebd977f2c82567f52b1e534a1f (patch) | |
tree | de386cf42fd3f3a5576d12dc5ba897b4e98dbe1c /llvm/lib/Object/WasmObjectFile.cpp | |
parent | fedbd264e39ba36022f208c4612da472cae0953f (diff) | |
download | llvm-99e5c5256ff2eeebd977f2c82567f52b1e534a1f.zip llvm-99e5c5256ff2eeebd977f2c82567f52b1e534a1f.tar.gz llvm-99e5c5256ff2eeebd977f2c82567f52b1e534a1f.tar.bz2 |
[libc++] Fix std::__debug_less in c++17.
b07b5bd72716625e0976a84d23652d94d8d0165a adds a use of `__comp_ref_type.h` to `std::min`. When libc++ is built with `-D_LIBCPP_DEBUG=0`, this enables `std::__debug_less`, which is only marked constexpr after c++17.
`std::min` itself is marked as being `constexpr` as of c++14, so by extension, `std::__debug_less` should also be marked `constexpr` for the same versions so that `std::min` can use it. This change lowers the guard from `> 17` to `> 11`.
Reproducer in godbolt: https://godbolt.org/z/ans3TGsj8
```
constexpr int x() { return std::min<int>({1, 2, 3, 4}); }
static_assert(x() == 1);
```
Reviewed By: #libc, philnik, Quuxplusone, ldionne
Differential Revision: https://reviews.llvm.org/D118940
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions