]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/54249 ([C++11] No ::nullptr_t in header <stddef.h>)
authorPaolo Carlini <paolo@gcc.gnu.org>
Sat, 6 Oct 2012 22:44:12 +0000 (22:44 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sat, 6 Oct 2012 22:44:12 +0000 (22:44 +0000)
2012-10-06  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/54249
* ginclude/stddef.h: In C++11 mode declare nullptr_t in the global
namespace.

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

PR c++/54249
* g++.dg/cpp0x/stddef.C: New.

From-SVN: r192173

gcc/ChangeLog
gcc/ginclude/stddef.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/stddef.C [new file with mode: 0644]

index 4a677d5096eed56012bc7a06799d0f85d1148d6d..a198490318bb4a0ad90e9bfcce8a6529bb3c8fcd 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54249
+       * ginclude/stddef.h: In C++11 mode declare nullptr_t in the global
+       namespace.
+
 2012-10-06  Jan Hubicka  <jh@suse.cz>
 
        PR lto/53831
@@ -23,7 +29,7 @@
 
 2012-10-06  Jan Hubicka  <jh@suse.cz>
 
-       PR lto/54790 
+       PR lto/54790
        * lto-streamer.h (lto_symtab_register_decl, lto_symtab_get_resolution,
        lto_mark_nothrow_fndecl, lto_fixup_nothrow_decls): Remove.
        * lto-symtab.c (lto_symtab_register_decl): Remove.
index fc8cfa674f0d9225cc11584d0c8def3414baf6ea..9f6e7419ca1c0583f2529b36bc67623322d1358f 100644 (file)
@@ -427,6 +427,13 @@ typedef struct {
 #endif
 #endif /* C11 or C++11.  */
 
+#if defined(__cplusplus) && __cplusplus >= 201103L
+#ifndef _GXX_NULLPTR_T
+#define _GXX_NULLPTR_T
+  typedef decltype(nullptr) nullptr_t;
+#endif
+#endif /* C++11.  */
+
 #endif /* _STDDEF_H was defined this time */
 
 #endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
index 1a28cda577cd8fc0733547c030061d741d500993..24a28b0b5faff6f049c76a9ba253c728adfc6fec 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-06  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/54249
+       * g++.dg/cpp0x/stddef.C: New.
+
 2012-10-06  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/54832
diff --git a/gcc/testsuite/g++.dg/cpp0x/stddef.C b/gcc/testsuite/g++.dg/cpp0x/stddef.C
new file mode 100644 (file)
index 0000000..dad9200
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/54249
+// { dg-do compile { target c++11 } }
+
+#include <stddef.h>
+
+::nullptr_t n;
This page took 0.118619 seconds and 5 git commands to generate.