Reverting merge from trunk
[official-gcc.git] / libstdc++-v3 / testsuite / 20_util / is_nothrow_constructible / value.cc
blob0488ae37f5aaa0d1d1d7082b4f1f1a47cb2c9d69
1 // { dg-options "-std=gnu++0x" }
3 // 2010-06-09 Paolo Carlini <paolo.carlini@oracle.com>
5 // Copyright (C) 2010-2013 Free Software Foundation, Inc.
6 //
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
11 // any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3. If not see
20 // <http://www.gnu.org/licenses/>.
22 #include <type_traits>
23 #include <testsuite_hooks.h>
24 #include <testsuite_tr1.h>
26 void test01()
28 bool test __attribute__((unused)) = true;
29 using std::is_nothrow_constructible;
30 using namespace __gnu_test;
32 // Positive tests.
33 VERIFY( (test_property<is_nothrow_constructible, NoexceptExplicitClass,
34 double&>(true)) );
35 VERIFY( (test_property<is_nothrow_constructible, NoexceptExplicitClass,
36 int&>(true)) );
37 VERIFY( (test_property<is_nothrow_constructible, NoexceptExplicitClass,
38 double&, int&, double&>(true)) );
39 VERIFY( (test_property<is_nothrow_constructible, NothrowExplicitClass,
40 double&>(true)) );
41 VERIFY( (test_property<is_nothrow_constructible, NothrowExplicitClass,
42 int&>(true)) );
43 VERIFY( (test_property<is_nothrow_constructible, NothrowExplicitClass,
44 double&, int&, double&>(true)) );
46 VERIFY( (test_property<is_nothrow_constructible, int[1]>(true)) );
48 // Negative tests.
49 VERIFY( (test_property<is_nothrow_constructible, NoexceptExplicitClass,
50 void*>(false)) );
51 VERIFY( (test_property<is_nothrow_constructible, NoexceptExplicitClass>
52 (false)) );
53 VERIFY( (test_property<is_nothrow_constructible, NoexceptExplicitClass,
54 int, double>(false)) );
55 VERIFY( (test_property<is_nothrow_constructible, NothrowExplicitClass,
56 void*>(false)) );
57 VERIFY( (test_property<is_nothrow_constructible, NothrowExplicitClass>
58 (false)) );
59 VERIFY( (test_property<is_nothrow_constructible, NothrowExplicitClass,
60 int, double>(false)) );
62 VERIFY( (test_property<is_nothrow_constructible, ExceptExplicitClass,
63 double&>(false)) );
64 VERIFY( (test_property<is_nothrow_constructible, ExceptExplicitClass,
65 int&>(false)) );
66 VERIFY( (test_property<is_nothrow_constructible, ExceptExplicitClass,
67 double&, int&, double&>(false)) );
68 VERIFY( (test_property<is_nothrow_constructible, ThrowExplicitClass,
69 double&>(false)) );
70 VERIFY( (test_property<is_nothrow_constructible, ThrowExplicitClass,
71 int&>(false)) );
72 VERIFY( (test_property<is_nothrow_constructible, ThrowExplicitClass,
73 double&, int&, double&>(false)) );
75 VERIFY( (test_property<is_nothrow_constructible, int[]>(false)) );
78 int main()
80 test01();
81 return 0;