From: Jonathan Wakely Date: Mon, 22 Sep 2014 16:01:53 +0000 (+0100) Subject: Include in and . X-Git-Tag: upstream/12.2.0~60215 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7666d649f80feb0d9944e5affbe9f0687084054a;p=platform%2Fupstream%2Fgcc.git 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 46efe32..5cd422e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,14 @@ 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. * doc/xml/manual/status_cxx2014.xml: Update TS status. * doc/html/manual/status.html: Regenerate. diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h index b516664..32124e3 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 ee187da..f4bb72c 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 0000000..efe73ae --- /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 0000000..42106ca --- /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 0000000..3663d63 --- /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" );