https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114962
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs-reduction | --- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- // PR c++/114962 template <typename _Tp, int _Nm> struct __array_traits { using _Type = _Tp[_Nm]; }; template <typename _Tp, int _Nm> struct array { typedef _Tp value_type; typedef value_type *const_iterator; __array_traits<_Tp, _Nm>::_Type _M_elems; constexpr const_iterator begin() const { return const_iterator(_M_elems); } constexpr const_iterator end() const { return const_iterator(); } constexpr value_type &operator[](long __n) { return _M_elems[__n]; } }; struct A { void third(); static constexpr array kArray = [] { array<void (A::*)(), 3> a; a[0] = a[1] = a[2] = &A::third; return a; }(); static_assert([] { for (auto item : kArray) if (item) return true; return false; }(), ""); };