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

fiesh at zefix dot tv changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fiesh at zefix dot tv

--- Comment #7 from fiesh at zefix dot tv ---
I suppose this snippet also exhibits this bug here?

template <int... Is> struct IntegerSequence {};

template <int i> struct IntegralConstant {
  constexpr auto operator()() const { return i; }
};

template <typename F, typename IndexType, IndexType... index>
constexpr void apply(F const &f, IntegerSequence<index...>) {
  (f(IntegralConstant<index>{}), ...);
}

template <auto size, typename F> constexpr void constexpr_foreach(F const &f) {
  apply<F, int>(f, IntegerSequence<0>{});
}

int main() {
  static int i[1] = {42};

  int j{};
  constexpr_foreach<1>([&j](auto const index) { j += i[index()]; });
  return j;
}

Reply via email to