summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/30_threads/promise
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-07 15:01:33 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-07 15:01:33 +0000
commit7903c81247823e360dbbdcf0e27425b1a86a09ee (patch)
tree30850f33b00dc6cf6fb619896993a9ff8417f621 /libstdc++-v3/testsuite/30_threads/promise
parent0663474603e8cbf38cf8a560cfbbbe47b5f686da (diff)
downloadgcc-7903c81247823e360dbbdcf0e27425b1a86a09ee.tar.gz
Use std::addressof in insert iterators, allocators and promises
PR libstdc++/69105 PR libstdc++/69106 PR libstdc++/69114 * include/bits/stl_iterator.h (back_insert_iterator, front_insert_iterator, insert_iterator): Use __addressof (LWG 2324). * include/bits/uses_allocator.h (__use_alloc): Use __addressof. * include/std/future (__future::base::_State_baseV2::__setter): Likewise. * include/std/scoped_allocator (__outermost): Likewise. * testsuite/20_util/scoped_allocator/69114.cc: New. * testsuite/20_util/uses_allocator/69114.cc: New. * testsuite/30_threads/promise/69106.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232129 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/30_threads/promise')
-rw-r--r--libstdc++-v3/testsuite/30_threads/promise/69106.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/30_threads/promise/69106.cc b/libstdc++-v3/testsuite/30_threads/promise/69106.cc
new file mode 100644
index 00000000000..921ded13dea
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/promise/69106.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2016 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/>.
+
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-atomic-builtins "" }
+
+#include <future>
+
+struct foo {
+ void operator&() const = delete;
+};
+
+void test01()
+{
+ std::promise<foo> p;
+ p.set_value(foo());
+}