Fix broken MinGW build of gcc.c
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wzero-as-null-pointer-constant-2.C
blob317d852c95d8673da8ccd3410ad599c4ef990b46
1 // PR c++/51045
2 // { dg-options "-Wzero-as-null-pointer-constant" }
4 template <typename T>
5 struct A
7   A() { t = new T; }
9   ~A()
10   {
11     delete t;
12   }
13   T* t;
16 template <typename T>
17 struct B
19   B() { t = new T[1]; }
21   ~B()
22   {
23     delete [] t;
24   }
25   T* t;
28 template <typename Type>
29 class Variant
31   Type t;
34 class Op;
36 typedef Variant<A<Op> > vara;
37 typedef Variant<B<Op> > varb;
39 class Op
41   vara x;
42   varb y;
45 int main()
47   vara a;
48   varb b;