1// { dg-options "-std=gnu++11" }
2// { dg-do compile }
3//
4// 2014-10-09  Ville Voutilainen  <ville.voutilainen@gmail.com>
5//
6// Copyright (C) 2014-2015 Free Software Foundation, Inc.
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 <type_traits>
24#include <testsuite_tr1.h>
25
26struct HasTemplateCCtor
27{
28  HasTemplateCCtor(const HasTemplateCCtor&) = default;
29  template <class T>
30  HasTemplateCCtor(T&&);
31};
32
33struct MoveOnly
34{
35  MoveOnly(MoveOnly&&) = default;
36};
37
38struct MoveOnly2
39{
40  MoveOnly2(MoveOnly2&&) = delete;
41};
42
43void test01()
44{
45  using std::is_trivially_move_constructible;
46  using namespace __gnu_test;
47
48  static_assert(test_property<is_trivially_move_constructible,
49		int>(true), "");
50  static_assert(test_property<is_trivially_move_constructible,
51		TType>(true), "");
52  static_assert(test_property<is_trivially_move_constructible,
53		PODType>(true), "");
54  static_assert(test_property<is_trivially_move_constructible,
55		NType>(false), "");
56  static_assert(test_property<is_trivially_move_constructible,
57		SLType>(false), "");
58  static_assert(test_property<is_trivially_move_constructible,
59		construct::DelDef>(true), "");
60  static_assert(test_property<is_trivially_move_constructible,
61		construct::Abstract>(false), "");
62  static_assert(test_property<is_trivially_move_constructible,
63		construct::Ellipsis>(true), "");
64  static_assert(test_property<is_trivially_move_constructible,
65		construct::DelEllipsis>(true), "");
66  static_assert(test_property<is_trivially_move_constructible,
67		construct::Any>(true), "");
68  static_assert(test_property<is_trivially_move_constructible,
69		construct::DelCopy>(false), "");
70  static_assert(test_property<is_trivially_move_constructible,
71		construct::DelDtor>(false), "");
72  static_assert(test_property<is_trivially_move_constructible,
73		construct::Nontrivial>(false), "");
74  static_assert(test_property<is_trivially_move_constructible,
75		construct::UnusualCopy>(false), "");
76  static_assert(test_property<is_trivially_move_constructible,
77		CopyConsOnlyType>(false), "");
78  static_assert(test_property<is_trivially_move_constructible,
79		MoveConsOnlyType>(true), "");
80  static_assert(test_property<is_trivially_move_constructible,
81		HasTemplateCCtor>(false), "");
82  static_assert(test_property<is_trivially_move_constructible,
83		MoveOnly>(true), "");
84  static_assert(test_property<is_trivially_move_constructible,
85		MoveOnly2>(false), "");
86}
87