[Bug c++/79588] [7 Regression] ICE in warn_for_restrict with -Wrestrict

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Feb 20 11:11:00 GMT 2017


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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Indeed, consider e.g.
// PR c++/79588
// { dg-do compile }
// { dg-options "-Wrestrict" }

void foo (char *__restrict, char *__restrict = __null);

template <int N>
void
bar (char **p)
{
  foo (p[0], p[0]);     // { dg-warning "to restrict-qualified parameter
aliases with" }
  foo (p[0], p[N]);     // { dg-warning "to restrict-qualified parameter
aliases with" }
}

void
baz (char **p)
{
  bar<0> (p);
}

where there is no warning in the second foo invocation, because it is done too
early.


More information about the Gcc-bugs mailing list