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

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Although this is accepted even though it's in a template, so it's more
complicated than just template vs non-template:

template<int N = 5>
consteval void f( char const* p )
{
  char buf[N]{};

  if (p == buf) // unspecified
    return;

  for (int i = 0; i < 5; ++i)
    buf[i] = p[i];
}

int main()
{
  f("test");
}

Reply via email to