PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wrestrict-2.C
blob4bab03bc850628f55f38822b0c2ea33da42333ef
1 // PR c++/79588
2 // { dg-do compile }
3 // { dg-options "-Wrestrict" }
5 void foo (char *__restrict, char *__restrict = __null);
7 template <int N>
8 void
9 bar (char **p)
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]);
16 template <int N>
17 void
18 bar2 (char **p)
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]);
25 void
26 baz (char **p)
28   bar<0> (p);
29   bar2<1> (p);