[libcxx-commits] [PATCH] D68365: [libc++] Implement P1004R2 (constexpr std::vector)

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 16 05:21:58 PDT 2022


philnik added a comment.

In D68365#3725775 <https://reviews.llvm.org/D68365#3725775>, @sberg wrote:

> 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)

We are aware of that. See https://llvm.org/PR56782.


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