[libcxx-commits] [libcxx] [libc++] constexpr deque (PR #129368)

Nhat Nguyen via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 9 21:34:20 PDT 2025


================
@@ -619,19 +620,20 @@ public:
       __alloc_traits::deallocate(__alloc(), *__i, __block_size);
   }
 
-  _LIBCPP_HIDE_FROM_ABI explicit deque(const allocator_type& __a)
+  _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 explicit deque(const allocator_type& __a)
       : __map_(__pointer_allocator(__a)), __start_(0), __size_(0), __alloc_(__a) {
     __annotate_new(0);
----------------
changkhothuychung wrote:

@frederick-vs-ja when trying to call the test in a constexpr case, via static_assert, I got error that `__annotate_new (0)` cannot be used in a constant expression, this function is called within a constexpr constructor. How should I handle this case? Can `__annotate_new ` be made constexpr ?  

https://github.com/llvm/llvm-project/pull/129368


More information about the libcxx-commits mailing list