OSDN Git Service

/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Dec 2011 01:40:36 +0000 (01:40 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Dec 2011 01:40:36 +0000 (01:40 +0000)
2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51313
* call.c (null_ptr_cst_p): STRIP_NOPS in c++11 mode too.

/testsuite
2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51313
* g++.dg/cpp0x/pr51313.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181980 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr51313.C [new file with mode: 0644]

index 201f5ef..8f26f23 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51313
+       * call.c (null_ptr_cst_p): STRIP_NOPS in c++11 mode too.
+
 2011-12-01  Jason Merrill  <jason@redhat.com>
 
        * call.c (build_new_method_call_1): Handle aggregate initialization.
index 548a36b..93d14be 100644 (file)
@@ -549,10 +549,8 @@ null_ptr_cst_p (tree t)
     {
       /* Core issue 903 says only literal 0 is a null pointer constant.  */
       if (cxx_dialect < cxx0x)
-       {
-         t = integral_constant_value (t);
-         STRIP_NOPS (t);
-       }
+       t = integral_constant_value (t);
+      STRIP_NOPS (t);
       if (integer_zerop (t) && !TREE_OVERFLOW (t))
        return true;
     }
index c7cfa2c..17e2179 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51313
+       * g++.dg/cpp0x/pr51313.C: New.
+
 2011-12-03  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/48887
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr51313.C b/gcc/testsuite/g++.dg/cpp0x/pr51313.C
new file mode 100644 (file)
index 0000000..ff078e0
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/51313
+// { dg-options "-std=c++0x" }
+
+class ostream;
+
+extern "C" {
+  extern int isdigit (int);
+}
+
+ostream&
+operator<<(ostream&, const unsigned char*);
+
+extern ostream cout;
+
+int main()
+{
+  cout << isdigit(0);
+}