gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C
raw| 1 | // PR c++/52718 |
| 2 | // { dg-options "-Wzero-as-null-pointer-constant -Wno-return-type" } |
| 3 | |
| 4 | struct foo |
| 5 | { |
| 6 | foo(void* a = 0) {}; // { dg-warning "17: zero as null pointer" } |
| 7 | }; |
| 8 | |
| 9 | void* fun(void* a = 0) {}; // { dg-warning "zero as null pointer" } |
| 10 | |
| 11 | struct bar: foo |
| 12 | { |
| 13 | bar() {}; |
| 14 | }; |
| 15 | |
| 16 | struct baz |
| 17 | { |
| 18 | baz(const foo& f1 = foo(), |
| 19 | void* f2 = fun()) {}; |
| 20 | }; |