1 |
742 |
jeremybenn |
// { dg-options "-std=gnu++0x" }
|
2 |
|
|
// { dg-do compile }
|
3 |
|
|
|
4 |
|
|
// Copyright (C) 2011 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 <initializer_list>
|
23 |
|
|
#include <testsuite_tr1.h>
|
24 |
|
|
|
25 |
|
|
using namespace __gnu_test::construct_destruct;
|
26 |
|
|
|
27 |
|
|
static_assert(std::is_destructible<int>::value, "Error");
|
28 |
|
|
static_assert(std::is_destructible<const int>::value, "Error");
|
29 |
|
|
static_assert(std::is_destructible<bool>::value, "Error");
|
30 |
|
|
static_assert(std::is_destructible<const bool>::value, "Error");
|
31 |
|
|
static_assert(std::is_destructible<int*>::value, "Error");
|
32 |
|
|
static_assert(std::is_destructible<void*>::value, "Error");
|
33 |
|
|
static_assert(std::is_destructible<int B::*>::value, "Error");
|
34 |
|
|
static_assert(std::is_destructible<const int D::*>::value, "Error");
|
35 |
|
|
static_assert(std::is_destructible<E>::value, "Error");
|
36 |
|
|
static_assert(std::is_destructible<const E>::value, "Error");
|
37 |
|
|
static_assert(std::is_destructible<SE>::value, "Error");
|
38 |
|
|
static_assert(std::is_destructible<const SE>::value, "Error");
|
39 |
|
|
static_assert(std::is_destructible<OpE>::value, "Error");
|
40 |
|
|
static_assert(std::is_destructible<const OpE>::value, "Error");
|
41 |
|
|
static_assert(std::is_destructible<OpSE>::value, "Error");
|
42 |
|
|
static_assert(std::is_destructible<const OpSE>::value, "Error");
|
43 |
|
|
static_assert(std::is_destructible<std::nullptr_t>::value, "Error");
|
44 |
|
|
static_assert(std::is_destructible<const std::nullptr_t>::value, "Error");
|
45 |
|
|
static_assert(std::is_destructible<B>::value, "Error");
|
46 |
|
|
static_assert(std::is_destructible<const B>::value, "Error");
|
47 |
|
|
static_assert(std::is_destructible<D>::value, "Error");
|
48 |
|
|
static_assert(std::is_destructible<const D>::value, "Error");
|
49 |
|
|
static_assert(std::is_destructible<Empty>::value, "Error");
|
50 |
|
|
static_assert(std::is_destructible<const Empty>::value, "Error");
|
51 |
|
|
static_assert(std::is_destructible<U>::value, "Error");
|
52 |
|
|
static_assert(std::is_destructible<const U>::value, "Error");
|
53 |
|
|
static_assert(std::is_destructible<Abstract>::value, "Error");
|
54 |
|
|
static_assert(std::is_destructible<const Abstract>::value, "Error");
|
55 |
|
|
static_assert(std::is_destructible<int[1]>::value, "Error");
|
56 |
|
|
static_assert(std::is_destructible<const int[1]>::value, "Error");
|
57 |
|
|
static_assert(std::is_destructible<int[1][2]>::value, "Error");
|
58 |
|
|
static_assert(std::is_destructible<const int[1][2]>::value, "Error");
|
59 |
|
|
static_assert(std::is_destructible<int&>::value, "Error");
|
60 |
|
|
static_assert(std::is_destructible<int&&>::value, "Error");
|
61 |
|
|
static_assert(std::is_destructible<void(&)()>::value, "Error");
|
62 |
|
|
static_assert(std::is_destructible<Ellipsis>::value, "Error");
|
63 |
|
|
static_assert(std::is_destructible<const Ellipsis>::value, "Error");
|
64 |
|
|
static_assert(std::is_destructible<Any>::value, "Error");
|
65 |
|
|
static_assert(std::is_destructible<const Any>::value, "Error");
|
66 |
|
|
static_assert(std::is_destructible<nAny>::value, "Error");
|
67 |
|
|
static_assert(std::is_destructible<const nAny>::value, "Error");
|
68 |
|
|
static_assert(std::is_destructible<DelDef>::value, "Error");
|
69 |
|
|
static_assert(std::is_destructible<const DelDef>::value, "Error");
|
70 |
|
|
static_assert(std::is_destructible<DelCopy>::value, "Error");
|
71 |
|
|
static_assert(std::is_destructible<const DelCopy>::value, "Error");
|
72 |
|
|
static_assert(std::is_destructible<DelEllipsis>::value, "Error");
|
73 |
|
|
static_assert(std::is_destructible<const DelEllipsis>::value, "Error");
|
74 |
|
|
static_assert(std::is_destructible<std::initializer_list<int>>::value,
|
75 |
|
|
"Error");
|
76 |
|
|
static_assert(std::is_destructible<const std::initializer_list<int>>::value,
|
77 |
|
|
"Error");
|
78 |
|
|
static_assert(std::is_destructible<void()>::value, "Error");
|
79 |
|
|
static_assert(std::is_destructible<void() const>::value, "Error");
|
80 |
|
|
|
81 |
|
|
static_assert(!std::is_destructible<void>::value, "Error");
|
82 |
|
|
static_assert(!std::is_destructible<const void>::value, "Error");
|
83 |
|
|
static_assert(!std::is_destructible<int[]>::value, "Error");
|
84 |
|
|
static_assert(!std::is_destructible<const int[]>::value, "Error");
|
85 |
|
|
static_assert(!std::is_destructible<DelDtor>::value, "Error");
|
86 |
|
|
static_assert(!std::is_destructible<const DelDtor>::value, "Error");
|
87 |
|
|
static_assert(!std::is_destructible<AbstractDelDtor>::value, "Error");
|
88 |
|
|
static_assert(!std::is_destructible<const AbstractDelDtor>::value, "Error");
|
89 |
|
|
static_assert(!std::is_destructible<int[][1]>::value, "Error");
|
90 |
|
|
static_assert(!std::is_destructible<const int[][1]>::value, "Error");
|
91 |
|
|
static_assert(!std::is_destructible<DelDtor[1]>::value, "Error");
|
92 |
|
|
static_assert(!std::is_destructible<const DelDtor[1]>::value, "Error");
|
93 |
|
|
static_assert(!std::is_destructible<DelDtor[]>::value, "Error");
|
94 |
|
|
static_assert(!std::is_destructible<const DelDtor[]>::value, "Error");
|
95 |
|
|
|
96 |
|
|
// Deleted members in unions with non-trivial members:
|
97 |
|
|
static_assert(!std::is_destructible<NontrivialUnion>::value, "Error");
|
98 |
|
|
|
99 |
|
|
// Unusual copy:
|
100 |
|
|
static_assert(std::is_destructible<UnusualCopy>::value, "Error");
|