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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Or this version is valid C++11 (and accepted by clang and EDG):

template<typename T, unsigned N>
  struct array
  {
    T _M_data[N];
  };

template<typename _Tp, _Tp... _Idx>
  struct integer_sequence
  {
  };

struct Pos
{
  unsigned l;
};

template<class T, T... Ints>
constexpr array<Pos, sizeof...(Ints)> make_grid_position(integer_sequence<T,
Ints...>)
{
  return {{ Pos{Ints}... }};
}

constexpr array<Pos, 1> make_grid_positions()
{
  return make_grid_position(integer_sequence<unsigned, 0>{});
}

template<class T>
void generate_sudoku(T)
{
  constexpr auto positions = make_grid_positions(); // fail
}

int main()
{
  constexpr auto positions = make_grid_positions(); // ok
  generate_sudoku(1);
}

Reply via email to