https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108258
Bug ID: 108258
Summary: std::ranges::begin() fails on zero sized std::array
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: mwd at md5i dot com
Target Milestone: ---
The following snippet fails to compile (with -std=c++20) in snapshot
gcc-13-20221225.
#include <array>
#include <ranges>
static constexpr std::array<int, 0> a;
static constexpr auto b = std::ranges::begin(a);
This appears to be because __array_traits<T, 0>::Type's members aren't
constexpr. This compiled in gcc-12.
Preprocessed sources attached.