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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase usable for testsuite:
template <typename T, int N>
struct A { T v[N]; };

constexpr A <int, 2>
foo ()
{
  A <int, 2> a {};
  a.v[1] = 1;
  a.v[0] = 1;
  return a;
}

constexpr A <int, 2> a = foo ();

int
main ()
{
  int k = 0;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < a.v[i]; j++)
      k++;
  if (k != 2)
    __builtin_abort ();
}

This got fixed on the trunk with r226949.
I'm surprised by the regression marker, as this seems to be broken since
r217663 when C++14 constexpr support has been added (before that it has been
rejected).
That said, it is a wrong-code bug, so maybe the r226949 change is backportable.
 Jason?

Reply via email to