aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2012-10-06 22:44:12 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-10-06 22:44:12 +0000
commit21c278c93069690772a23f9c162eeac0030b10f7 (patch)
tree80d49f82c98375af91e9f035dd46564ae94eae56
parent55d5c6aff7d868b5a5abf89908df29603fd37f92 (diff)
downloadgcc-21c278c93069690772a23f9c162eeac0030b10f7.zip
gcc-21c278c93069690772a23f9c162eeac0030b10f7.tar.gz
gcc-21c278c93069690772a23f9c162eeac0030b10f7.tar.bz2
re PR c++/54249 ([C++11] No ::nullptr_t in header <stddef.h>)
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
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/ginclude/stddef.h7
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/stddef.C6
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4a677d5..a198490 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
index fc8cfa6..9f6e741 100644
--- a/gcc/ginclude/stddef.h
+++ b/gcc/ginclude/stddef.h
@@ -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__
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1a28cda..24a28b0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..dad9200
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/stddef.C
@@ -0,0 +1,6 @@
+// PR c++/54249
+// { dg-do compile { target c++11 } }
+
+#include <stddef.h>
+
+::nullptr_t n;