PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wnonnull-compare-3.C
blobf909a0f27d91e83817f113f591b6efa1b82ffe9d
1 // PR c++/69850
2 // { dg-do compile }
3 // { dg-options "-Wnonnull-compare" }
5 template <typename T>
6 struct A {
7   static void foo (T *x) { x->bar (); }
8 };
9 template <typename T>
10 struct B {
11   T b;
12   void operator= (B) { A<T>::foo (&b); }
14 struct C {
15   void bar () { delete[] this; }        // { dg-bogus "nonnull argument" }
17 struct D { B<C> d; };
18 struct G {
19   D g[6];
20   void baz ();
22 int a;
24 void
25 G::baz ()
27   g[a] = g[1];