aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-06-11 09:50:55 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-06-11 09:50:55 +0000
commit899e00ebb25c3cc6bf87bded44e217ce8c81ed9c (patch)
tree92a99a96ac24c2fabb5fb9ab5e056327d1e3db3c
parent77cea46edbb0b526aa04e4bee9be85103de60fb2 (diff)
downloadgcc-899e00ebb25c3cc6bf87bded44e217ce8c81ed9c.zip
gcc-899e00ebb25c3cc6bf87bded44e217ce8c81ed9c.tar.gz
gcc-899e00ebb25c3cc6bf87bded44e217ce8c81ed9c.tar.bz2
re PR libstdc++/56019 (max_align_t should be in std namespace)
2013-06-11 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/56019 * include/c_global/cstddef (max_align_t): Add to namespace std. * include/c_std/cstddef: Likewise. * testsuite/18_support/max_align_t/requirements/1.cc: New. * testsuite/18_support/max_align_t/requirements/2.cc: Likewise. From-SVN: r199945
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/c_global/cstddef13
-rw-r--r--libstdc++-v3/include/c_std/cstddef8
-rw-r--r--libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc23
-rw-r--r--libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc24
5 files changed, 76 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ec9bfd2..60bc7b5 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2013-06-11 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/56019
+ * include/c_global/cstddef (max_align_t): Add to namespace std.
+ * include/c_std/cstddef: Likewise.
+ * testsuite/18_support/max_align_t/requirements/1.cc: New.
+ * testsuite/18_support/max_align_t/requirements/2.cc: Likewise.
+
2013-06-10 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/c++config (_GLIBCXX_ABI_TAG_CXX11): Add.
diff --git a/libstdc++-v3/include/c_global/cstddef b/libstdc++-v3/include/c_global/cstddef
index 00660f3..94d8957 100644
--- a/libstdc++-v3/include/c_global/cstddef
+++ b/libstdc++-v3/include/c_global/cstddef
@@ -36,7 +36,20 @@
// ISO C++ 14882: 18.1 Types
//
+#ifndef _GLIBCXX_CSTDDEF
+#define _GLIBCXX_CSTDDEF 1
+
#pragma GCC system_header
#include <bits/c++config.h>
#include <stddef.h>
+
+#if __cplusplus >= 201103L
+namespace std
+{
+ // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h.
+ using ::max_align_t;
+}
+#endif
+
+#endif // _GLIBCXX_CSTDDEF
diff --git a/libstdc++-v3/include/c_std/cstddef b/libstdc++-v3/include/c_std/cstddef
index 9500bc5..6f1b5bd 100644
--- a/libstdc++-v3/include/c_std/cstddef
+++ b/libstdc++-v3/include/c_std/cstddef
@@ -44,4 +44,12 @@
#include <bits/c++config.h>
#include <stddef.h>
+#if __cplusplus >= 201103L
+namespace std
+{
+ // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h.
+ using ::max_align_t;
+}
#endif
+
+#endif // _GLIBCXX_CSTDDEF
diff --git a/libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc
new file mode 100644
index 0000000..405e097
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/1.cc
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <cstddef>
+
+std::max_align_t t;
diff --git a/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc
new file mode 100644
index 0000000..d702720
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/max_align_t/requirements/2.cc
@@ -0,0 +1,24 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+//
+// Copyright (C) 2013 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <cstddef>
+#include <type_traits>
+
+static_assert (std::is_pod<std::max_align_t>::value, "");