| 1 |
// PR c++/79588 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-Wrestrict" } |
| 4 |
|
| 5 |
void foo (char *__restrict, char *__restrict = __null); |
| 6 |
|
| 7 |
template <int N> |
| 8 |
void |
| 9 |
bar (char **p) |
| 10 |
{ |
| 11 |
foo (p[0], p[0]); // { dg-warning "to 'restrict'-qualified parameter aliases with" } |
| 12 |
foo (p[0], p[N]); // { dg-warning "to 'restrict'-qualified parameter aliases with" } |
| 13 |
foo (p[0]); |
| 14 |
} |
| 15 |
|
| 16 |
template <int N> |
| 17 |
void |
| 18 |
bar2 (char **p) |
| 19 |
{ |
| 20 |
foo (p[0], p[0]); // { dg-warning "to 'restrict'-qualified parameter aliases with" } |
| 21 |
foo (p[0], p[N]); // { dg-bogus "to 'restrict'-qualified parameter aliases with" } |
| 22 |
foo (p[0]); |
| 23 |
} |
| 24 |
|
| 25 |
void |
| 26 |
baz (char **p) |
| 27 |
{ |
| 28 |
bar<0> (p); |
| 29 |
bar2<1> (p); |
| 30 |
} |