The Standard is currently unimplementable. We have to pick between:
- Not implementing constexpr support properly in std::array<T, 0>
- Making std::array<T, 0> non-trivial even when T is trivial
- Returning nullptr from std::array<T, 0>::begin()
Libc++ initially picked (1). In 77b9abfc8e89, we started implementing constexpr properly, but lost the guarantee of triviality. Since it seems like both (1) and (2) are really important, it seems like (3) is the only viable option for libc++, after all. This is also what other implementations are doing.
This patch moves libc++ from (1) to (3).
- Improves the test coverage for the various ways of initializing std::array
- Adds tests for the triviality of std::array
- Adds tests for the aggregate-ness of std::array