[libcxx-commits] [PATCH] D68365: [libc++] Implement P1004R2 (constexpr std::vector)
Stephan Bergmann via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 16 05:15:52 PDT 2022
sberg added a comment.
For a `-DLIBCXX_ENABLE_DEBUG_MODE=ON` build this now causes
$ cat test.cc
#define _LIBCPP_DEBUG 1
#include <vector>
static std::vector<int> v;
int main() {
v.push_back(0);
int a = 0;
for (auto i: v) a += i;
return a;
}
$ clang++ -stdlib=libc++ -std=c++20 test.cc
$ ./a.out
~/llvm/inst/bin/../include/c++/v1/__iterator/wrap_iter.h:87: assertion ::std::__libcpp_is_constant_evaluated() || (__get_const_db()->__dereferenceable(this)) failed: Attempted to dereference a non-dereferenceable iteratorAborted (core dumped)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68365/new/
https://reviews.llvm.org/D68365
More information about the libcxx-commits
mailing list