summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/30_threads/promise
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-08 16:45:54 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-08 16:45:54 +0000
commite0eb04b1d240ef23efb1494e7d7a0b0bff45c24d (patch)
treebe2c8d9ffb3c692a724ab2604acbeee10a7e8e42 /libstdc++-v3/testsuite/30_threads/promise
parent84463f7a07342d336fbeb05b9e764184bb10b57e (diff)
downloadgcc-e0eb04b1d240ef23efb1494e7d7a0b0bff45c24d.tar.gz
* include/bits/shared_ptr_base.h (_Sp_counted_ptr): Make 'final'.
(_Sp_counted_deleter): Make 'final'. Use allocator_traits. (_Sp_counted_ptr_inplace): Make 'final'. Use allocator_traits. Derive from _Sp_counted_ptr instead of _Sp_counted_deleter to use EBO for the allocator. (__shared_count, __shared_ptr): Use allocator_traits. * include/std/future (__future_base::_Result_alloc): Make 'final'. Use allocator traits. (__future_base::_Task_state): Make 'final'. (__future_base::_Deferred_state): Likewise. (__future_base::_Async_state): Likewise. * testsuite/20_util/shared_ptr/cons/alloc_min.cc: New. * testsuite/20_util/shared_ptr/creation/alloc_min.cc: New. * testsuite/20_util/shared_ptr/creation/private.cc: New. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers. * testsuite/30_threads/packaged_task/cons/alloc_min.cc: New. * testsuite/30_threads/promise/cons/alloc_min.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181171 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/30_threads/promise')
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
new file mode 100644
index 00000000000..ba7c55334f0
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/promise/cons/alloc_min.cc
@@ -0,0 +1,40 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-atomic-builtins "" }
+
+// Copyright (C) 2011 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/>.
+
+// Test that promise can use a minimal C++11 allocator
+// and doesn't rely on C++98 allocator interface.
+
+#include <future>
+#include <testsuite_allocator.h>
+
+using std::promise;
+using std::allocator_arg;
+using std::tuple;
+
+typedef promise<int> p;
+typedef promise<int&> pr;
+typedef promise<void> pv;
+__gnu_test::SimpleAllocator<p> a;
+
+tuple<p, pr, pv> t1{ allocator_arg, a };
+tuple<p, pr, pv> t2{ allocator_arg, a, p{}, pr{}, pv{} };