]> gcc.gnu.org Git - gcc.git/blame - libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc
Update copyright years.
[gcc.git] / libstdc++-v3 / testsuite / 20_util / is_move_constructible / value.cc
CommitLineData
44916fe1
PC
1// { dg-options "-std=gnu++11" }
2// { dg-do compile }
65cee9bd 3//
5624e564 4// Copyright (C) 2011-2015 Free Software Foundation, Inc.
65cee9bd
PC
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>
65cee9bd
PC
22#include <testsuite_tr1.h>
23
24void test01()
25{
65cee9bd
PC
26 using std::is_move_constructible;
27 using namespace __gnu_test;
28
29 // Positive tests.
44916fe1
PC
30 static_assert(test_category<is_move_constructible, int>(true), "");
31 static_assert(test_category<is_move_constructible, float>(true), "");
32 static_assert(test_category<is_move_constructible, EnumType>(true), "");
33 static_assert(test_category<is_move_constructible, int*>(true), "");
34 static_assert(test_category<is_move_constructible, int(*)(int)>(true), "");
35 static_assert(test_category<is_move_constructible,
36 int (ClassType::*)>(true), "");
37 static_assert(test_category<is_move_constructible,
38 int (ClassType::*) (int)>(true), "");
65cee9bd 39
44916fe1
PC
40 static_assert(test_property<is_move_constructible,
41 NoexceptMoveConsClass>(true), "");
42 static_assert(test_property<is_move_constructible,
43 ThrowMoveConsClass>(true), "");
44 static_assert(test_property<is_move_constructible,
45 ExceptMoveConsClass>(true), "");
65cee9bd
PC
46
47 // Negative tests.
44916fe1
PC
48 static_assert(test_category<is_move_constructible, void>(false), "");
49 static_assert(test_category<is_move_constructible, int[2]>(false), "");
50 static_assert(test_category<is_move_constructible, int[]>(false), "");
51 static_assert(test_category<is_move_constructible, float[][3]>(false), "");
52 static_assert(test_category<is_move_constructible,
53 EnumType[2][3][4]>(false), "");
54 static_assert(test_category<is_move_constructible, int*[3]>(false), "");
55 static_assert(test_category<is_move_constructible,
56 int(*[][2])(int)>(false), "");
57 static_assert(test_category<is_move_constructible,
58 int (ClassType::*[2][3])>(false), "");
59 static_assert(test_category<is_move_constructible,
60 int (ClassType::*[][2][3]) (int)>(false), "");
61 static_assert(test_category<is_move_constructible,
62 ClassType(unsigned) const &>(false), "");
63 static_assert(test_category<is_move_constructible,
64 bool(ClassType) const>(false), "");
65 static_assert(test_category<is_move_constructible,
66 bool(...) &&>(false), "");
67 static_assert(test_category<is_move_constructible,
68 EnumType(int, ...)>(false), "");
65cee9bd 69
44916fe1
PC
70 static_assert(test_property<is_move_constructible,
71 const NoexceptMoveConsClass>(false), "");
72 static_assert(test_property<is_move_constructible,
73 volatile NoexceptMoveConsClass>(false), "");
65cee9bd 74}
This page took 0.374013 seconds and 5 git commands to generate.