]>
Commit | Line | Data |
---|---|---|
2789f415 | 1 | // { dg-do compile } |
4415f7a5 | 2 | // { dg-options "-std=gnu++11" } |
2789f415 PC |
3 | |
4 | // 2011-05-20 Paolo Carlini <paolo.carlini@oracle.com> | |
5 | // | |
5624e564 | 6 | // Copyright (C) 2011-2015 Free Software Foundation, Inc. |
2789f415 PC |
7 | // |
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) | |
12 | // any later version. | |
13 | // | |
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. | |
18 | // | |
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/>. | |
22 | ||
23 | #include <utility> | |
24 | #include <testsuite_tr1.h> | |
25 | ||
26 | using namespace __gnu_test; | |
27 | ||
28 | typedef std::pair<int, int> tt1; | |
29 | typedef std::pair<int, double> tt2; | |
30 | typedef std::pair<short, NoexceptMoveAssignClass> tt4; | |
31 | typedef std::pair<ExceptMoveAssignClass, double> tt6; | |
32 | typedef std::pair<int, ExceptMoveConsClass> tt9; | |
33 | typedef std::pair<ExceptMoveAssignClass, short> tt10; | |
34 | typedef std::pair<short, NoexceptMoveConsClass> tt11; | |
35 | typedef std::pair<NoexceptMoveConsClass, | |
36 | NoexceptMoveConsClass> tt12; | |
37 | typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, | |
38 | NoexceptMoveConsNoexceptMoveAssignClass> tt13; | |
39 | typedef std::pair<ExceptMoveConsNoexceptMoveAssignClass, | |
40 | ExceptMoveConsNoexceptMoveAssignClass> tt14; | |
41 | typedef std::pair<NoexceptMoveConsExceptMoveAssignClass, | |
42 | NoexceptMoveConsExceptMoveAssignClass> tt15; | |
43 | typedef std::pair<ExceptMoveConsExceptMoveAssignClass, | |
44 | ExceptMoveConsExceptMoveAssignClass> tt16; | |
45 | typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, | |
46 | double> tt17; | |
47 | typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, | |
48 | NoexceptMoveConsNoexceptMoveAssignClass> tt19; | |
49 | typedef std::pair<NoexceptMoveConsNoexceptMoveAssignClass, | |
50 | ExceptMoveConsNoexceptMoveAssignClass> tt21; | |
51 | ||
52 | static_assert(noexcept(std::declval<tt1&>().swap(std::declval<tt1&>())), | |
53 | "Error"); | |
54 | static_assert(noexcept(std::declval<tt2&>().swap(std::declval<tt2&>())), | |
55 | "Error"); | |
56 | static_assert(noexcept(std::declval<tt4&>().swap(std::declval<tt4&>())), | |
57 | "Error"); | |
58 | static_assert(!noexcept(std::declval<tt6&>().swap(std::declval<tt6&>())), | |
59 | "Error"); | |
60 | static_assert(!noexcept(std::declval<tt9&>().swap(std::declval<tt9&>())), | |
61 | "Error"); | |
62 | static_assert(!noexcept(std::declval<tt10&>().swap(std::declval<tt10&>())), | |
63 | "Error"); | |
64 | static_assert(noexcept(std::declval<tt11&>().swap(std::declval<tt11&>())), | |
65 | "Error"); | |
66 | static_assert(noexcept(std::declval<tt12&>().swap(std::declval<tt12&>())), | |
67 | "Error"); | |
68 | static_assert(noexcept(std::declval<tt13&>().swap(std::declval<tt13&>())), | |
69 | "Error"); | |
70 | static_assert(!noexcept(std::declval<tt14&>().swap(std::declval<tt14&>())), | |
71 | "Error"); | |
72 | static_assert(!noexcept(std::declval<tt15&>().swap(std::declval<tt15&>())), | |
73 | "Error"); | |
74 | static_assert(!noexcept(std::declval<tt16&>().swap(std::declval<tt16&>())), | |
75 | "Error"); | |
76 | static_assert(noexcept(std::declval<tt17&>().swap(std::declval<tt17&>())), | |
77 | "Error"); | |
78 | static_assert(noexcept(std::declval<tt19&>().swap(std::declval<tt19&>())), | |
79 | "Error"); | |
80 | static_assert(!noexcept(std::declval<tt21&>().swap(std::declval<tt21&>())), | |
81 | "Error"); |