S/390: Deprecate g5 and g6 CPU levels
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wconversion-null.C
blobe2ca13e514c6549ab2e0b7e7a829a871b5a71ebe
1 // { dg-do link  }
2 // { dg-options "-Wconversion -Wno-conversion-null -Wno-pointer-arith" }
4 #include <cstddef>
6 void g(int) {}
7 void g(long) {}
8 void g(long long) {}
9 extern void g(void*);
11 template <int I>
12 void h() {}
14 void k(int) {}
16 template <class T>
17 void l(T);
19 template <>
20 void l(int) {}
22 template <>
23 void l(long) {}
25 template <>
26 void l(long long) {}
28 int main()
30   int i = NULL; //  converting NULL to non-pointer type
31   float z = NULL; //  converting NULL to non-pointer type
32   int a[2];
34   i != NULL; //  NULL used in arithmetic
35   NULL != z; //  NULL used in arithmetic
36   k != NULL; // No warning: decay conversion
37   NULL != a; // Likewise.
38   -NULL;     //  converting NULL to non-pointer type
39   +NULL;     //  converting NULL to non-pointer type
40   ~NULL;     //  converting NULL to non-pointer type
41   a[NULL] = 3; //  converting NULL to non-pointer-type
42   i = NULL;  //  converting NULL to non-pointer type
43   z = NULL;  //  converting NULL to non-pointer type
44   k(NULL);   //  converting NULL to int
45   g(NULL);   //  converting NULL to int
46   h<NULL>(); // No warning: NULL bound to integer template parameter
47   l(NULL);   //  converting NULL to int
48   NULL && NULL; // No warning: converting NULL to bool is OK