[libcxx-commits] [libcxx] [libc++] Fix constexpr initialization of std::array<T, 0> (PR #74667)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 13 07:35:07 PST 2023


================
@@ -280,7 +280,8 @@ struct _LIBCPP_TEMPLATE_VIS array<_Tp, 0>
     typedef std::reverse_iterator<iterator>       reverse_iterator;
     typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
 
-    typedef __conditional_t<is_const<_Tp>::value, const char, char> _CharType;
+    struct _EmptyAggregate { };
+    typedef __conditional_t<is_const<_Tp>::value, const _EmptyAggregate, _EmptyAggregate> _CharType;
----------------
ldionne wrote:

I agree with renaming to `_EmptyType`, that was an oversight. However, I'd like to keep the `__maybe_const` out of this change, since it's really unrelated.

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


More information about the libcxx-commits mailing list