Open
Description
Change 0fb76ba introduced a regression in std::sort
.
Building
#include <algorithm>
#include <vector>
int main() {
std::vector<int> other_ops;
for (int i = 0; i < 1024; ++i) {
other_ops.push_back(i);
}
std::sort(other_ops.begin(), other_ops.end(), std::greater<int>());
}
with
~/llvm/build/bin/clang++ -O2 -fsanitize=integer ubsan_test.cpp -stdlib=libc++ -static-libstdc++ -l:libc++abi.a
crashes with the following error:
include/c++/v1/__bit/blsr.h:25:23: runtime error: negation of 18446744073709551615 cannot be represented in type 'unsigned long'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior include/c++/v1/__bit/blsr.h:25:23