https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123611

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That should be in what GCC currently implements
#include <array>


void f() {
  static constexpr std::array arr2 = {^^int, ^^bool};
  //template for (constexpr auto Pair : arr2) { }
  static constexpr decltype(auto) range = (arr2);
  static constexpr auto b = begin (range);
  static constexpr auto e = end (range);
  {
    static constexpr auto iter = b + decltype(b - b){ptrdiff_t(0)};
    constexpr auto Pair = *iter;
  }
  {
    static constexpr auto iter = b + decltype(b - b){ptrdiff_t(1)};
    constexpr auto Pair = *iter;
  }
}
(note, only part of CWG3044 implemented and CWG3140 not implemented at all),
and that
compiles that way fine.
Will have a look tomorrow.

Reply via email to