public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [v3] Fix libstdc++/56019
@ 2013-06-11  9:52 Paolo Carlini
  0 siblings, 0 replies; only message in thread
From: Paolo Carlini @ 2013-06-11  9:52 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++

[-- Attachment #1: Type: text/plain, Size: 91 bytes --]

Hi,

tested x86_64-linux, committed to mainline.

Thanks,
Paolo.

////////////////////////

[-- Attachment #2: CL_56019 --]
[-- Type: text/plain, Size: 301 bytes --]

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.

[-- Attachment #3: patch_56019 --]
[-- Type: text/plain, Size: 3371 bytes --]

Index: include/c_global/cstddef
===================================================================
--- include/c_global/cstddef	(revision 199937)
+++ include/c_global/cstddef	(working copy)
@@ -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
Index: include/c_std/cstddef
===================================================================
--- include/c_std/cstddef	(revision 199937)
+++ include/c_std/cstddef	(working copy)
@@ -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
Index: testsuite/18_support/max_align_t/requirements/1.cc
===================================================================
--- testsuite/18_support/max_align_t/requirements/1.cc	(revision 0)
+++ testsuite/18_support/max_align_t/requirements/1.cc	(working copy)
@@ -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;
Index: testsuite/18_support/max_align_t/requirements/2.cc
===================================================================
--- testsuite/18_support/max_align_t/requirements/2.cc	(revision 0)
+++ testsuite/18_support/max_align_t/requirements/2.cc	(working copy)
@@ -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, "");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-11  9:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-11  9:52 [v3] Fix libstdc++/56019 Paolo Carlini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).