1 // { dg-do compile { target c++11 } }
2 // { dg-options "-Wzero-as-null-pointer-constant" }
6 typedef int (A::*pointmemfun) (int);
7 typedef int (A::*pointdmem);
8 typedef int (*pointfun) (int);
17 pointmemfun pmf(0); // { dg-warning "zero as null pointer" }
18 pointdmem pdm(0); // { dg-warning "zero as null pointer" }
19 pointfun pf(0); // { dg-warning "zero as null pointer" }
20 int* p(0); // { dg-warning "zero as null pointer" }
22 pointmemfun pmfn(nullptr);
23 pointdmem pdmn(nullptr);
24 pointfun pfn(nullptr);
27 pmf = 0; // { dg-warning "zero as null pointer" }
29 pdm = 0; // { dg-warning "zero as null pointer" }
31 pf = 0; // { dg-warning "zero as null pointer" }
33 p = 0; // { dg-warning "zero as null pointer" }
67 if (pmf == 0) // { dg-warning "zero as null pointer" }
70 if (pdm == 0) // { dg-warning "zero as null pointer" }
73 if (pf == 0) // { dg-warning "zero as null pointer" }
76 if (p == 0) // { dg-warning "zero as null pointer" }
79 if (0 == pmf) // { dg-warning "zero as null pointer" }
82 if (0 == pdm) // { dg-warning "zero as null pointer" }
85 if (0 == pf) // { dg-warning "zero as null pointer" }
88 if (0 == p) // { dg-warning "zero as null pointer" }
91 if (pmf != 0) // { dg-warning "zero as null pointer" }
94 if (pdm != 0) // { dg-warning "zero as null pointer" }
97 if (pf != 0) // { dg-warning "zero as null pointer" }
100 if (p != 0) // { dg-warning "zero as null pointer" }
103 if (0 != pmf) // { dg-warning "zero as null pointer" }
106 if (0 != pdm) // { dg-warning "zero as null pointer" }
109 if (0 != pf) // { dg-warning "zero as null pointer" }
112 if (0 != p) // { dg-warning "zero as null pointer" }