With regard to this note:

There is a single element of the aggregate, of an unspecified empty aggregate type.

I believe that resolution is unsatisfactory as it would be a forced abi break for libc++.

What is the chance a fix can be retroactively applied to C++17? I am not sure what is the process for a defect report and how it differs from regular proposals.

On Fri, Dec 15, 2023, 3:37 PM Jonathan Wakely <cxx@kayari.org> wrote:


On Fri, 15 Dec 2023 at 21:56, Ryan Nicholl via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
I would like to semi-formally propose a defect report related to std::array and existing standards.

It turns out std::array<T, 0> cannot be implemented in C++17 without the use of magic compiler builtins. libc++, libstdc++, and I think also MSVC are all non-compliant.

Begin and end are required to return a unique pointer, the only constexpr method I have found to do this is taking the address of a union member. However, that approach breaks if T is non-trivial.



Glibc libstdc++ libc++ ignores the standard requirement of uniqueness in favor of following the trivial and constexpr requirements. Both of these implementations return nullptr.

N.B. There's no such thing as Glibc libstdc++. Libstdc++ is part of GCC, which is a completely separate project from Glibc.