OSDN Git Service

/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 May 2012 21:06:42 +0000 (21:06 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 May 2012 21:06:42 +0000 (21:06 +0000)
2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/53301
* decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.

/testsuite
2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/53301
* g++.dg/warn/Wzero-as-null-pointer-constant-6.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@187378 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-6.C [new file with mode: 0644]

index c7683bf..77ea188 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/53301
+       * decl.c (check_default_argument): Fix typo (POINTER_TYPE_P
+       instead of TYPE_PTR_P) in zero-as-null-pointer-constant warning.
+
 2012-05-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/53186
index 1cf78b0..b62f10e 100644 (file)
@@ -10578,7 +10578,7 @@ check_default_argument (tree decl, tree arg)
 
   if (warn_zero_as_null_pointer_constant
       && c_inhibit_evaluation_warnings == 0
-      && (POINTER_TYPE_P (decl_type) || TYPE_PTR_TO_MEMBER_P (decl_type))
+      && (TYPE_PTR_P (decl_type) || TYPE_PTR_TO_MEMBER_P (decl_type))
       && null_ptr_cst_p (arg)
       && !NULLPTR_TYPE_P (TREE_TYPE (arg)))
     {
index 3892db5..11b2e5d 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-10  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/53301
+       * g++.dg/warn/Wzero-as-null-pointer-constant-6.C: New.
+
 2012-05-10  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/lto11.ad[sb]: New test.
diff --git a/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-6.C b/gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-6.C
new file mode 100644 (file)
index 0000000..4a76b5c
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/53301
+// { dg-options "-Wzero-as-null-pointer-constant" }
+
+class x { public: x(int v) {} };
+
+void foo(const x& = 0);