From 7666d649f80feb0d9944e5affbe9f0687084054a Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 22 Sep 2014 17:01:53 +0100 Subject: [PATCH] Include in and . * include/bits/stl_queue.h: Include missing header. * include/bits/stl_stack.h: Likewise. * testsuite/23_containers/priority_queue/requirements/ uses_allocator.cc: New. * testsuite/23_containers/queue/requirements/uses_allocator.cc: New. * testsuite/23_containers/stack/requirements/uses_allocator.cc: New. From-SVN: r215470 --- libstdc++-v3/ChangeLog | 9 ++++++ libstdc++-v3/include/bits/stl_queue.h | 3 ++ libstdc++-v3/include/bits/stl_stack.h | 3 ++ .../requirements/uses_allocator.cc | 29 +++++++++++++++++++ .../queue/requirements/uses_allocator.cc | 29 +++++++++++++++++++ .../stack/requirements/uses_allocator.cc | 29 +++++++++++++++++++ 6 files changed, 102 insertions(+) create mode 100644 libstdc++-v3/testsuite/23_containers/priority_queue/requirements/uses_allocator.cc create mode 100644 libstdc++-v3/testsuite/23_containers/queue/requirements/uses_allocator.cc create mode 100644 libstdc++-v3/testsuite/23_containers/stack/requirements/uses_allocator.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 46efe322709..5cd422e4a11 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2014-09-22 Jonathan Wakely + + * include/bits/stl_queue.h: Include missing header. + * include/bits/stl_stack.h: Likewise. + * testsuite/23_containers/priority_queue/requirements/ + uses_allocator.cc: New. + * testsuite/23_containers/queue/requirements/uses_allocator.cc: New. + * testsuite/23_containers/stack/requirements/uses_allocator.cc: New. + 2014-09-22 Jonathan Wakely * doc/xml/manual/status_cxx2011.xml: Update C++11 status. diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h index b516664b612..32124e34b50 100644 --- a/libstdc++-v3/include/bits/stl_queue.h +++ b/libstdc++-v3/include/bits/stl_queue.h @@ -58,6 +58,9 @@ #include #include +#if __cplusplus >= 201103L +# include +#endif namespace std _GLIBCXX_VISIBILITY(default) { diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h index ee187da8ee3..f4bb72c3891 100644 --- a/libstdc++-v3/include/bits/stl_stack.h +++ b/libstdc++-v3/include/bits/stl_stack.h @@ -58,6 +58,9 @@ #include #include +#if __cplusplus >= 201103L +# include +#endif namespace std _GLIBCXX_VISIBILITY(default) { diff --git a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/uses_allocator.cc b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/uses_allocator.cc new file mode 100644 index 00000000000..efe73aee879 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/uses_allocator.cc @@ -0,0 +1,29 @@ +// Copyright (C) 2014 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 +// . + +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +#include + +template + using uses_allocator = std::uses_allocator, A>; + +static_assert( uses_allocator>::value, "valid allocator" ); + +struct X { }; +static_assert( !uses_allocator::value, "invalid allocator" ); diff --git a/libstdc++-v3/testsuite/23_containers/queue/requirements/uses_allocator.cc b/libstdc++-v3/testsuite/23_containers/queue/requirements/uses_allocator.cc new file mode 100644 index 00000000000..42106caf8a5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/queue/requirements/uses_allocator.cc @@ -0,0 +1,29 @@ +// Copyright (C) 2014 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 +// . + +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +#include + +template + using uses_allocator = std::uses_allocator, A>; + +static_assert( uses_allocator>::value, "valid allocator" ); + +struct X { }; +static_assert( !uses_allocator::value, "invalid allocator" ); diff --git a/libstdc++-v3/testsuite/23_containers/stack/requirements/uses_allocator.cc b/libstdc++-v3/testsuite/23_containers/stack/requirements/uses_allocator.cc new file mode 100644 index 00000000000..3663d633b45 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/stack/requirements/uses_allocator.cc @@ -0,0 +1,29 @@ +// Copyright (C) 2014 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 +// . + +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +#include + +template + using uses_allocator = std::uses_allocator, A>; + +static_assert( uses_allocator>::value, "valid allocator" ); + +struct X { }; +static_assert( !uses_allocator::value, "invalid allocator" ); -- 2.30.2