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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 9 22:58:29 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);
----------------
frederick-vs-ja wrote:

Yes. I think we can mark most underlying ASAN-related functions (which are not previously `constexpr`) `_LIBCPP_CONSTEXPR_SINCE_CXX26` and add `if (__libcpp_is_constant_evaluated()) return;` to suitable places.

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


More information about the libcxx-commits mailing list