diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-11-24 10:20:43 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-11-24 10:20:43 +0000 |
commit | 36b0e7519f8e86d3fa5df495fce260874ebbcbb2 (patch) | |
tree | 182b1a887fd8a3ac3f929b70e0ef69c09b4036c0 /gcc/testsuite | |
parent | 282d42f2cb590792eb99aa8a8c9dd2f1b41763b1 (diff) | |
download | gcc-36b0e7519f8e86d3fa5df495fce260874ebbcbb2.zip gcc-36b0e7519f8e86d3fa5df495fce260874ebbcbb2.tar.gz gcc-36b0e7519f8e86d3fa5df495fce260874ebbcbb2.tar.bz2 |
re PR c++/51290 (Bogus warning: zero as null pointer constant with static_cast)
/cp
2011-11-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51290
* class.c (build_base_path): For the null pointer check use
nullptr_node instead of integer_zero_node.
/testsuite
2011-11-24 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51290
* g++.dg/warn/Wzero-as-null-pointer-constant-3.C: New.
From-SVN: r181690
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-3.C | 22 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4be809d..5674c28 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-11-24 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/51290 + * g++.dg/warn/Wzero-as-null-pointer-constant-3.C: New. + 2011-11-23 Jakub Jelinek <jakub@redhat.com> PR target/51261 diff --git a/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-3.C b/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-3.C new file mode 100644 index 0000000..ed54143 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-3.C @@ -0,0 +1,22 @@ +// PR c++/51290 +// { dg-options "-Wzero-as-null-pointer-constant" } + +class A { int a; }; + +class B { int b; }; + +class C : public A, public B +{ + private: + static void foo (A *x) + { + C *y = static_cast<C *>(x); + (void) y; + } + + static void bar (B *x) + { + C *y = static_cast<C *>(x); + (void) y; + } +}; |