1 // { dg-options "-std=gnu++0x" }
2 // { dg-require-cstdint "" }
3 // { dg-require-gthreads "" }
4 // { dg-require-atomic-builtins "" }
6 // Copyright (C) 2010 Free Software Foundation
8 // This file is part of the GNU ISO C++ Library. This library is free
9 // software; you can redistribute it and/or modify it under the
10 // terms of the GNU General Public License as published by the
11 // Free Software Foundation; either version 3, or (at your option)
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License along
20 // with this library; see the file COPYING3. If not see
21 // <http://www.gnu.org/licenses/>.
23 // 30.6.7 Class template shared_future [futures.shared_future]
26 #include <testsuite_hooks.h>
28 // This test verifies behaviour which is encouraged by a non-normative note,
34 bool test __attribute__((unused)) = true;
36 std::shared_future<int> f;
42 catch (std::future_error& e)
44 VERIFY( e.code() == std::future_errc::no_state );
51 bool test __attribute__((unused)) = true;
53 std::shared_future<int&> f;
59 catch (std::future_error& e)
61 VERIFY( e.code() == std::future_errc::no_state );
68 bool test __attribute__((unused)) = true;
70 std::shared_future<void> f;
76 catch (std::future_error& e)
78 VERIFY( e.code() == std::future_errc::no_state );