diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-2.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-2.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-2.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-2.C new file mode 100644 index 0000000..5cb4022 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/Wzero-as-null-pointer-constant-2.C @@ -0,0 +1,15 @@ +// PR c++/56373 +// { dg-do compile { target c++11 } } +// { dg-options "-Wzero-as-null-pointer-constant" } + +struct shared_ptr +{ + shared_ptr(decltype(nullptr)); +}; + +void f() +{ + shared_ptr a = 0; // { dg-warning "zero as null pointer" } + shared_ptr b(0); // { dg-warning "zero as null pointer" } + shared_ptr c{0}; // { dg-warning "zero as null pointer" } +} |