1// { dg-options "-std=gnu++11" }
2// { dg-do compile }
3//
4// Copyright (C) 2011-2015 Free Software Foundation, Inc.
5//
6// This file is part of the GNU ISO C++ Library.  This library is free
7// software; you can redistribute it and/or modify it under the
8// terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 3, or (at your option)
10// any later version.
11//
12// This library is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License along
18// with this library; see the file COPYING3.  If not see
19// <http://www.gnu.org/licenses/>.
20
21#include <type_traits>
22#include <testsuite_tr1.h>
23
24void test01()
25{
26  using std::is_nothrow_move_constructible;
27  using namespace __gnu_test;
28
29  // Positive tests.
30  static_assert(test_category<is_nothrow_move_constructible, int>(true), "");
31  static_assert(test_category<is_nothrow_move_constructible, float>(true), "");
32  static_assert(test_category<is_nothrow_move_constructible,
33		EnumType>(true), "");
34  static_assert(test_category<is_nothrow_move_constructible, int*>(true), "");
35  static_assert(test_category<is_nothrow_move_constructible,
36		int(*)(int)>(true), "");
37  static_assert(test_category<is_nothrow_move_constructible,
38		int (ClassType::*)>(true), "");
39  static_assert(test_category<is_nothrow_move_constructible,
40		int (ClassType::*) (int)>(true), "");
41
42  static_assert(test_property<is_nothrow_move_constructible,
43		NoexceptMoveConsClass>(true), "");
44
45  // Negative tests.
46  static_assert(test_category<is_nothrow_move_constructible, void>(false), "");
47  static_assert(test_category<is_nothrow_move_constructible,
48		int[2]>(false), "");
49  static_assert(test_category<is_nothrow_move_constructible,
50		int[]>(false), "");
51  static_assert(test_category<is_nothrow_move_constructible,
52		float[][3]>(false), "");
53  static_assert(test_category<is_nothrow_move_constructible,
54		EnumType[2][3][4]>(false), "");
55  static_assert(test_category<is_nothrow_move_constructible,
56		int*[3]>(false), "");
57  static_assert(test_category<is_nothrow_move_constructible,
58		int(*[][2])(int)>(false), "");
59  static_assert(test_category<is_nothrow_move_constructible,
60		int (ClassType::*[2][3])>(false), "");
61  static_assert(test_category<is_nothrow_move_constructible,
62		int (ClassType::*[][2][3]) (int)>(false), "");
63  static_assert(test_category<is_nothrow_move_constructible,
64		ClassType(unsigned) const &>(false), "");
65  static_assert(test_category<is_nothrow_move_constructible,
66		bool(ClassType) const>(false), "");
67  static_assert(test_category<is_nothrow_move_constructible,
68		bool(...) &&>(false), "");
69  static_assert(test_category<is_nothrow_move_constructible,
70		EnumType(int, ...)>(false), "");
71
72  static_assert(test_property<is_nothrow_move_constructible,
73		const NoexceptMoveConsClass>(false), "");
74  static_assert(test_property<is_nothrow_move_constructible,
75		volatile NoexceptMoveConsClass>(false), "");
76  static_assert(test_property<is_nothrow_move_constructible,
77		ThrowMoveConsClass>(false), "");
78  static_assert(test_property<is_nothrow_move_constructible,
79		ExceptMoveConsClass>(false), "");
80}
81