From: Paolo Carlini Date: Fri, 6 Dec 2013 23:08:41 +0000 (+0000) Subject: testsuite_tr1.h (test_category, [...]): constexpr in c++11 mode. X-Git-Tag: releases/gcc-4.9.0~2225 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44916fe15f5fac8269d61ba10bada95be1ab9dfe;p=thirdparty%2Fgcc.git testsuite_tr1.h (test_category, [...]): constexpr in c++11 mode. 2013-12-06 Paolo Carlini * testsuite/util/testsuite_tr1.h (test_category, test_property, test_relationship): constexpr in c++11 mode. * testsuite/20_util/add_lvalue_reference/value.cc: Use static_assert and change to dg-do compile testcase. * testsuite/20_util/add_rvalue_reference/value.cc: Likewise. * testsuite/20_util/aligned_storage/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_assign/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/is_compound/value.cc: Likewise. * testsuite/20_util/is_constructible/value.cc: Likewise. * testsuite/20_util/is_convertible/value.cc: Likewise. * testsuite/20_util/is_copy_assignable/value.cc: Likewise. * testsuite/20_util/is_copy_constructible/value.cc: Likewise. * testsuite/20_util/is_floating_point/value.cc: Likewise. * testsuite/20_util/is_function/value.cc: Likewise. * testsuite/20_util/is_fundamental/value.cc: Likewise. * testsuite/20_util/is_integral/value.cc: Likewise. * testsuite/20_util/is_literal_type/value.cc: Likewise. * testsuite/20_util/is_lvalue_reference/value.cc: Likewise. * testsuite/20_util/is_member_function_pointer/value.cc: Likewise. * testsuite/20_util/is_member_object_pointer/value.cc: Likewise. * testsuite/20_util/is_member_pointer/value.cc: Likewise. * testsuite/20_util/is_move_assignable/value.cc: Likewise. * testsuite/20_util/is_move_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_copy_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_copy_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_default_constructible/value.cc: Likewise. * testsuite/20_util/is_nothrow_move_assignable/value.cc: Likewise. * testsuite/20_util/is_nothrow_move_constructible/value.cc: Likewise. * testsuite/20_util/is_null_pointer/value.cc: Likewise. * testsuite/20_util/is_object/value.cc: Likewise. * testsuite/20_util/is_pod/value.cc: Likewise. * testsuite/20_util/is_reference/value.cc: Likewise. * testsuite/20_util/is_rvalue_reference/value.cc: Likewise. * testsuite/20_util/is_scalar/value.cc: Likewise. * testsuite/20_util/is_signed/value.cc: Likewise. * testsuite/20_util/is_standard_layout/value.cc: Likewise. * testsuite/20_util/is_trivial/value.cc: Likewise. * testsuite/20_util/is_trivially_destructible/value.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Likewise. * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise. * testsuite/20_util/remove_reference/value.cc: Likewise. From-SVN: r205766 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 912b89fd0d17..e437e5eecbcf 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,53 @@ +2013-12-06 Paolo Carlini + + * testsuite/util/testsuite_tr1.h (test_category, test_property, + test_relationship): constexpr in c++11 mode. + * testsuite/20_util/add_lvalue_reference/value.cc: Use static_assert + and change to dg-do compile testcase. + * testsuite/20_util/add_rvalue_reference/value.cc: Likewise. + * testsuite/20_util/aligned_storage/value.cc: Likewise. + * testsuite/20_util/has_trivial_copy_assign/value.cc: Likewise. + * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. + * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. + * testsuite/20_util/is_compound/value.cc: Likewise. + * testsuite/20_util/is_constructible/value.cc: Likewise. + * testsuite/20_util/is_convertible/value.cc: Likewise. + * testsuite/20_util/is_copy_assignable/value.cc: Likewise. + * testsuite/20_util/is_copy_constructible/value.cc: Likewise. + * testsuite/20_util/is_floating_point/value.cc: Likewise. + * testsuite/20_util/is_function/value.cc: Likewise. + * testsuite/20_util/is_fundamental/value.cc: Likewise. + * testsuite/20_util/is_integral/value.cc: Likewise. + * testsuite/20_util/is_literal_type/value.cc: Likewise. + * testsuite/20_util/is_lvalue_reference/value.cc: Likewise. + * testsuite/20_util/is_member_function_pointer/value.cc: Likewise. + * testsuite/20_util/is_member_object_pointer/value.cc: Likewise. + * testsuite/20_util/is_member_pointer/value.cc: Likewise. + * testsuite/20_util/is_move_assignable/value.cc: Likewise. + * testsuite/20_util/is_move_constructible/value.cc: Likewise. + * testsuite/20_util/is_nothrow_assignable/value.cc: Likewise. + * testsuite/20_util/is_nothrow_constructible/value.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_assignable/value.cc: Likewise. + * testsuite/20_util/is_nothrow_copy_constructible/value.cc: Likewise. + * testsuite/20_util/is_nothrow_default_constructible/value.cc: Likewise. + * testsuite/20_util/is_nothrow_move_assignable/value.cc: Likewise. + * testsuite/20_util/is_nothrow_move_constructible/value.cc: Likewise. + * testsuite/20_util/is_null_pointer/value.cc: Likewise. + * testsuite/20_util/is_object/value.cc: Likewise. + * testsuite/20_util/is_pod/value.cc: Likewise. + * testsuite/20_util/is_reference/value.cc: Likewise. + * testsuite/20_util/is_rvalue_reference/value.cc: Likewise. + * testsuite/20_util/is_scalar/value.cc: Likewise. + * testsuite/20_util/is_signed/value.cc: Likewise. + * testsuite/20_util/is_standard_layout/value.cc: Likewise. + * testsuite/20_util/is_trivial/value.cc: Likewise. + * testsuite/20_util/is_trivially_destructible/value.cc: Likewise. + * testsuite/20_util/is_unsigned/value.cc: Likewise. + * testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise. + * testsuite/20_util/make_unsigned/requirements/typedefs-1.cc: Likewise. + * testsuite/20_util/make_unsigned/requirements/typedefs-2.cc: Likewise. + * testsuite/20_util/remove_reference/value.cc: Likewise. + 2013-12-03 Jonathan Wakely * include/std/fstream (basic_filebuf::open): Use preformatted text diff --git a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc index 152f03a6cb14..ed862865146b 100644 --- a/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/add_lvalue_reference/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2007-06-02 Paolo Carlini // // Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -19,35 +21,37 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::add_lvalue_reference; using std::is_same; using namespace __gnu_test; - VERIFY( (is_same::type, int&>::value) ); - VERIFY( (is_same::type, int&>::value) ); - VERIFY( (is_same::type, const int&>::value) ); - VERIFY( (is_same::type, int*&>::value) ); - VERIFY( (is_same::type, ClassType&>::value) ); - VERIFY( (is_same::type, ClassType&>::value) ); - VERIFY( (is_same::type, int(&)(int)>::value) ); - VERIFY( (is_same::type, int&>::value) ); - VERIFY( (is_same::type, ClassType&>::value) ); - VERIFY( (is_same::type, void>::value) ); - VERIFY( (is_same::type, const void>::value) ); - VERIFY( (is_same::type, bool(int) const>::value) ); - VERIFY( (is_same::type, bool(int) &>::value) ); - VERIFY( (is_same::type, bool(int) const &&>::value) ); - VERIFY( (is_same::type, bool(&)(int)>::value) ); -} - -int main() -{ - test01(); - return 0; + static_assert(is_same::type, int&>::value, ""); + static_assert(is_same::type, int&>::value, "" ); + static_assert(is_same::type, + const int&>::value, ""); + static_assert(is_same::type, int*&>::value, ""); + static_assert(is_same::type, + ClassType&>::value, ""); + static_assert(is_same::type, + ClassType&>::value, ""); + static_assert(is_same::type, + int(&)(int)>::value, ""); + static_assert(is_same::type, int&>::value, ""); + static_assert(is_same::type, + ClassType&>::value, ""); + static_assert(is_same::type, void>::value, ""); + static_assert(is_same::type, + const void>::value, ""); + static_assert(is_same::type, + bool(int) const>::value, ""); + static_assert(is_same::type, + bool(int) &>::value, ""); + static_assert(is_same::type, + bool(int) const &&>::value, ""); + static_assert(is_same::type, + bool(&)(int)>::value, ""); } diff --git a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc index 7dcb1dcec986..468c438fdd12 100644 --- a/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/add_rvalue_reference/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2007-06-02 Paolo Carlini // // Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -19,34 +21,35 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::add_rvalue_reference; using std::is_same; using namespace __gnu_test; - VERIFY( (is_same::type, int&&>::value) ); - VERIFY( (is_same::type, int&&>::value) ); - VERIFY( (is_same::type, int&>::value) ); - VERIFY( (is_same::type, const int&&>::value) ); - VERIFY( (is_same::type, int*&&>::value) ); - VERIFY( (is_same::type, ClassType&&>::value) ); - VERIFY( (is_same::type, ClassType&&>::value) ); - VERIFY( (is_same::type, int(&&)(int)>::value) ); - VERIFY( (is_same::type, void>::value) ); - VERIFY( (is_same::type, const void>::value) ); - VERIFY( (is_same::type, bool(int) const>::value) ); - VERIFY( (is_same::type, bool(int) &>::value) ); - VERIFY( (is_same::type, bool(int) const &&>::value) ); - VERIFY( (is_same::type, bool(&&)(int)>::value) ); -} - -int main() -{ - test01(); - return 0; + static_assert(is_same::type, int&&>::value, ""); + static_assert(is_same::type, int&&>::value, ""); + static_assert(is_same::type, int&>::value, ""); + static_assert(is_same::type, + const int&&>::value, ""); + static_assert(is_same::type, int*&&>::value, ""); + static_assert(is_same::type, + ClassType&&>::value, ""); + static_assert(is_same::type, + ClassType&&>::value, ""); + static_assert(is_same::type, + int(&&)(int)>::value, ""); + static_assert(is_same::type, void>::value, ""); + static_assert(is_same::type, + const void>::value, ""); + static_assert(is_same::type, + bool(int) const>::value, ""); + static_assert(is_same::type, + bool(int) &>::value, ""); + static_assert(is_same::type, + bool(int) const &&>::value, ""); + static_assert(is_same::type, + bool(&&)(int)>::value, ""); } diff --git a/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc b/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc index adae72158d53..4edbdbed7930 100644 --- a/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc +++ b/libstdc++-v3/testsuite/20_util/aligned_storage/value.cc @@ -1,4 +1,5 @@ // { dg-options "-std=gnu++0x" } +// { dg-do compile } // 2007-09-17 Paolo Carlini // // Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -19,49 +20,43 @@ // . #include -#include #include struct MSAlignType { } __attribute__((__aligned__)); void test01() { - bool test __attribute__((unused)) = true; using std::aligned_storage; using std::alignment_of; using namespace __gnu_test; const std::size_t align_c = alignment_of::value; - VERIFY( (sizeof(aligned_storage<4, align_c>::type) >= 4) ); - VERIFY( (__alignof__(aligned_storage<4, align_c>::type) == align_c) ); + static_assert(sizeof(aligned_storage<4, align_c>::type) >= 4, ""); + static_assert(__alignof__(aligned_storage<4, align_c>::type) == align_c, ""); const std::size_t align_s = alignment_of::value; - VERIFY( (sizeof(aligned_storage<1, align_s>::type) >= 1) ); - VERIFY( (__alignof__(aligned_storage<1, align_s>::type) == align_s) ); + static_assert(sizeof(aligned_storage<1, align_s>::type) >= 1, ""); + static_assert(__alignof__(aligned_storage<1, align_s>::type) == align_s, ""); const std::size_t align_i = alignment_of::value; - VERIFY( (sizeof(aligned_storage<7, align_i>::type) >= 7) ); - VERIFY( (__alignof__(aligned_storage<7, align_i>::type) == align_i) ); + static_assert(sizeof(aligned_storage<7, align_i>::type) >= 7, ""); + static_assert(__alignof__(aligned_storage<7, align_i>::type) == align_i, ""); const std::size_t align_d = alignment_of::value; - VERIFY( (sizeof(aligned_storage<2, align_d>::type) >= 2) ); - VERIFY( (__alignof__(aligned_storage<2, align_d>::type) == align_d) ); + static_assert(sizeof(aligned_storage<2, align_d>::type) >= 2, ""); + static_assert(__alignof__(aligned_storage<2, align_d>::type) == align_d, ""); const std::size_t align_ai = alignment_of::value; - VERIFY( (sizeof(aligned_storage<20, align_ai>::type) >= 20) ); - VERIFY( (__alignof__(aligned_storage<20, align_ai>::type) == align_ai) ); + static_assert(sizeof(aligned_storage<20, align_ai>::type) >= 20, ""); + static_assert(__alignof__(aligned_storage<20, align_ai>::type) == align_ai, + ""); const std::size_t align_ct = alignment_of::value; - VERIFY( (sizeof(aligned_storage<11, align_ct>::type) >= 11) ); - VERIFY( (__alignof__(aligned_storage<11, align_ct>::type) == align_ct) ); + static_assert(sizeof(aligned_storage<11, align_ct>::type) >= 11, ""); + static_assert(__alignof__(aligned_storage<11, align_ct>::type) == align_ct, + ""); const std::size_t align_msa = alignment_of::value; - VERIFY( (sizeof(aligned_storage<5>::type) >= 5) ); - VERIFY( (__alignof__(aligned_storage<5>::type) == align_msa) ); -} - -int main() -{ - test01(); - return 0; + static_assert(sizeof(aligned_storage<5>::type) >= 5, ""); + static_assert(__alignof__(aligned_storage<5>::type) == align_msa, ""); } diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc index cbb6a02c9f28..3e7568d0bb04 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_assign/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2010-06-08 Paolo Carlini // // Copyright (C) 2010-2013 Free Software Foundation, Inc. @@ -19,39 +21,34 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::has_trivial_copy_assign; using namespace __gnu_test; - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_property(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc index a103a3c2f92a..5e91308de50f 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_copy_constructor/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2004-12-30 Paolo Carlini // // Copyright (C) 2004-2013 Free Software Foundation, Inc. @@ -21,38 +23,38 @@ // 4.5.3 Type properties #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::has_trivial_copy_constructor; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc index 8bc930cfdd66..c04908633a73 100644 --- a/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_trivial_default_constructor/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2004-12-26 Paolo Carlini // // Copyright (C) 2004-2013 Free Software Foundation, Inc. @@ -21,41 +23,44 @@ // 4.5.3 Type properties #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::has_trivial_default_constructor; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_compound/value.cc b/libstdc++-v3/testsuite/20_util/is_compound/value.cc index 936b73666636..ac04f55081f3 100644 --- a/libstdc++-v3/testsuite/20_util/is_compound/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_compound/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,43 +19,35 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_compound; using namespace __gnu_test; - - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); #ifdef _GLIBCXX_USE_WCHAR_T - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); #endif - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); // libstdc++/56609 - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); // Sanity check. - VERIFY( (test_category(true)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(true), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_constructible/value.cc index 25810f0bfdce..bfd9f144e340 100644 --- a/libstdc++-v3/testsuite/20_util/is_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_constructible/value.cc @@ -1,5 +1,5 @@ -// { dg-options "-std=gnu++0x" } - +// { dg-options "-std=gnu++11" } +// { dg-do compile } // Copyright (C) 2009-2013 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -18,28 +18,22 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_constructible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_convertible/value.cc b/libstdc++-v3/testsuite/20_util/is_convertible/value.cc index 000458a29554..97518a4dd2ae 100644 --- a/libstdc++-v3/testsuite/20_util/is_convertible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_convertible/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // 2009-10-29 Paolo Carlini // @@ -20,87 +21,98 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_convertible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); - VERIFY( (test_relationship(true)) ); + static_assert(test_relationship(true), ""); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); - VERIFY( (test_relationship(true)) ); + static_assert(test_relationship(true), ""); // Negative tests. - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); // C++0x - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc index af5e3ba777a9..4cc12d6e521d 100644 --- a/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_copy_assignable/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2011-05-19 Paolo Carlini // // Copyright (C) 2011-2013 Free Software Foundation, Inc. @@ -19,56 +21,57 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_copy_assignable; using namespace __gnu_test; // Positive tests. - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc index 0a9686d67e17..d05c21243fcb 100644 --- a/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_copy_constructible/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,64 +19,56 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_copy_constructible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); - VERIFY( (test_property(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc index 104775c5adee..d77687edce18 100644 --- a/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_floating_point/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,51 +19,45 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_floating_point; using namespace __gnu_test; - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); #ifdef _GLIBCXX_USE_WCHAR_T - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); #endif - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // GNU Extensions. #ifdef _GLIBCXX_USE_FLOAT128 - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); #endif #ifdef _GLIBCXX_USE_INT128 - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); #endif // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_function/value.cc b/libstdc++-v3/testsuite/20_util/is_function/value.cc index ce52ac9872d1..c38a3a1e7a16 100644 --- a/libstdc++-v3/testsuite/20_util/is_function/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_function/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,38 +19,32 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_function; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_fundamental/value.cc b/libstdc++-v3/testsuite/20_util/is_fundamental/value.cc index 00fa8822d389..b6ba4d09c7ea 100644 --- a/libstdc++-v3/testsuite/20_util/is_fundamental/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_fundamental/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,43 +19,35 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_fundamental; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); #ifdef _GLIBCXX_USE_WCHAR_T - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); #endif - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // libstdc++/56609 - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_integral/value.cc b/libstdc++-v3/testsuite/20_util/is_integral/value.cc index ff919d48c950..0ebc91b8d05e 100644 --- a/libstdc++-v3/testsuite/20_util/is_integral/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_integral/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2008-05-20 Paolo Carlini // // Copyright (C) 2008-2013 Free Software Foundation, Inc. @@ -19,54 +21,46 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_integral; using namespace __gnu_test; + + static_assert(test_category(false), ""); - VERIFY( (test_category(false)) ); - - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); #ifdef _GLIBCXX_USE_WCHAR_T - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); #endif - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); // GNU Extensions. #ifdef _GLIBCXX_USE_INT128 - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); #endif #ifdef _GLIBCXX_USE_FLOAT128 - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); #endif // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_literal_type/value.cc b/libstdc++-v3/testsuite/20_util/is_literal_type/value.cc index 067ff766f68b..703707c3b2b9 100644 --- a/libstdc++-v3/testsuite/20_util/is_literal_type/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_literal_type/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2010-03-23 Paolo Carlini // // Copyright (C) 2010-2013 Free Software Foundation, Inc. @@ -19,36 +21,28 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_literal_type; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); -} + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc index 6b117d81d1fa..d084fd97323b 100644 --- a/libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_lvalue_reference/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2007-06-02 Paolo Carlini // // Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -19,26 +21,19 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_lvalue_reference; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Sanity check. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/is_member_function_pointer/value.cc b/libstdc++-v3/testsuite/20_util/is_member_function_pointer/value.cc index 36d2abbaebfc..78da4749dfb9 100644 --- a/libstdc++-v3/testsuite/20_util/is_member_function_pointer/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_member_function_pointer/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,41 +19,34 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_member_function_pointer; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_member_object_pointer/value.cc b/libstdc++-v3/testsuite/20_util/is_member_object_pointer/value.cc index e451c1b094d0..88eb561aa937 100644 --- a/libstdc++-v3/testsuite/20_util/is_member_object_pointer/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_member_object_pointer/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,37 +19,35 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_member_object_pointer; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); // Sanity check. - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); } int main() diff --git a/libstdc++-v3/testsuite/20_util/is_member_pointer/value.cc b/libstdc++-v3/testsuite/20_util/is_member_pointer/value.cc index 3adc1d494b46..c74c9820d282 100644 --- a/libstdc++-v3/testsuite/20_util/is_member_pointer/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_member_pointer/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,36 +19,30 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_member_pointer; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc index c96f739a6355..bd7699af1670 100644 --- a/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_move_assignable/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2011-05-19 Paolo Carlini // // Copyright (C) 2011-2013 Free Software Foundation, Inc. @@ -19,56 +21,56 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_move_assignable; using namespace __gnu_test; // Positive tests. - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc index 94af3e1ba14d..b483eb029a3e 100644 --- a/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_move_constructible/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,64 +19,56 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_move_constructible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc index 1ea87e71dffc..ae4b4e049d45 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_assignable/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2011-05-19 Paolo Carlini // // Copyright (C) 2011-2013 Free Software Foundation, Inc. @@ -19,40 +21,37 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_nothrow_assignable; using namespace __gnu_test; // Positive tests. - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(true)) ); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); + static_assert(test_relationship(true), ""); // Negative tests. - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(false)) ); -} + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); + static_assert(test_relationship(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc index 0488ae37f5aa..f5fdddf4c9fd 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_constructible/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // 2010-06-09 Paolo Carlini @@ -20,63 +21,55 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_nothrow_constructible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_property(false)) ); - VERIFY( (test_property - (false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property - (false)) ); - VERIFY( (test_property(false)) ); + static_assert(test_property(false), ""); + static_assert(test_property + (false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property + (false), ""); + static_assert(test_property(false), ""); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); - VERIFY( (test_property(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc index 72ce0a069f1c..c787e4b5d592 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_assignable/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2010-06-08 Paolo Carlini // // Copyright (C) 2010-2013 Free Software Foundation, Inc. @@ -19,65 +21,59 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_nothrow_copy_assignable; using namespace __gnu_test; // Positive tests. - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc index 33d82af54e95..8b7d324a3fbd 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_copy_constructible/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2004-12-30 Paolo Carlini // // Copyright (C) 2004-2013 Free Software Foundation, Inc. @@ -19,64 +21,61 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_nothrow_copy_constructible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/value.cc index e04ff0c8c5ca..10ee4a474bf9 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_default_constructible/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2004-12-29 Paolo Carlini // // Copyright (C) 2004-2013 Free Software Foundation, Inc. @@ -19,55 +21,55 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_nothrow_default_constructible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); -} + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc index 54d94c2f2346..a7251a9e0f4a 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2011-05-19 Paolo Carlini // // Copyright (C) 2011-2013 Free Software Foundation, Inc. @@ -19,65 +21,59 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_nothrow_move_assignable; using namespace __gnu_test; // Positive tests. - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); - VERIFY( (test_property(true)) ); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc index 9afe428f7658..868e4e7b377f 100644 --- a/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_nothrow_move_constructible/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,64 +19,62 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_nothrow_move_constructible; using namespace __gnu_test; // Positive tests. - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_property(true)) ); + static_assert(test_property(true), ""); // Negative tests. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); - VERIFY( (test_property(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); + static_assert(test_property(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_null_pointer/value.cc b/libstdc++-v3/testsuite/20_util/is_null_pointer/value.cc index 2bee73a6a0b0..b4e2fa7ea316 100644 --- a/libstdc++-v3/testsuite/20_util/is_null_pointer/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_null_pointer/value.cc @@ -1,4 +1,6 @@ // { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2013-05-02 Paolo Carlini // // Copyright (C) 2013 Free Software Foundation, Inc. @@ -19,42 +21,36 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_null_pointer; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); -} + static_assert(test_category(true), ""); -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_object/value.cc b/libstdc++-v3/testsuite/20_util/is_object/value.cc index 458d11d83fb6..be35fb2eef15 100644 --- a/libstdc++-v3/testsuite/20_util/is_object/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_object/value.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // Copyright (C) 2011-2013 Free Software Foundation, Inc. // @@ -18,30 +19,23 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_object; using namespace __gnu_test; - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); // Sanity check. - VERIFY( (test_category(true)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(true), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_pod/value.cc b/libstdc++-v3/testsuite/20_util/is_pod/value.cc index ee9bb522dceb..93bcc040a4df 100644 --- a/libstdc++-v3/testsuite/20_util/is_pod/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_pod/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2010-02-21 Paolo Carlini // // Copyright (C) 2010-2013 Free Software Foundation, Inc. @@ -19,40 +21,33 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_pod; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); -} + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_reference/value.cc b/libstdc++-v3/testsuite/20_util/is_reference/value.cc index 14958935df8b..36c0c3530c20 100644 --- a/libstdc++-v3/testsuite/20_util/is_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_reference/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2007-06-02 Paolo Carlini // // Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -19,28 +21,21 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_reference; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Sanity check. - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); } -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc index e89ae2cc6fbc..45cf1476307b 100644 --- a/libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_rvalue_reference/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2007-06-02 Paolo Carlini // // Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -19,26 +21,18 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_rvalue_reference; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Sanity check. - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_scalar/value.cc b/libstdc++-v3/testsuite/20_util/is_scalar/value.cc index 05238e14023c..7e37565860bc 100644 --- a/libstdc++-v3/testsuite/20_util/is_scalar/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_scalar/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2010-11-30 Paolo Carlini // // Copyright (C) 2010-2013 Free Software Foundation, Inc. @@ -19,30 +21,22 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_scalar; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_signed/value.cc b/libstdc++-v3/testsuite/20_util/is_signed/value.cc index c01a52c13807..e72a4ef87b9f 100644 --- a/libstdc++-v3/testsuite/20_util/is_signed/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_signed/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2005-01-24 Paolo Carlini // // Copyright (C) 2005-2013 Free Software Foundation, Inc. @@ -19,52 +21,45 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_signed; using namespace __gnu_test; - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); - VERIFY( (test_category(char(-1) < char(0))) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(char(-1) < char(0)), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); #ifdef _GLIBCXX_USE_WCHAR_T - VERIFY( (test_category(wchar_t(-1) < wchar_t(0))) ); + static_assert(test_category + (wchar_t(-1) < wchar_t(0)), ""); #endif - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); // GNU Extensions. #ifdef _GLIBCXX_USE_INT128 - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); #endif #ifdef _GLIBCXX_USE_FLOAT128 - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); #endif // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_standard_layout/value.cc b/libstdc++-v3/testsuite/20_util/is_standard_layout/value.cc index ad1eacc9deb7..7bb417c88939 100644 --- a/libstdc++-v3/testsuite/20_util/is_standard_layout/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_standard_layout/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2010-03-23 Paolo Carlini // // Copyright (C) 2010-2013 Free Software Foundation, Inc. @@ -19,24 +21,16 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_standard_layout; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); -} + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_trivial/value.cc b/libstdc++-v3/testsuite/20_util/is_trivial/value.cc index f24fde5fbb91..1798dfb52836 100644 --- a/libstdc++-v3/testsuite/20_util/is_trivial/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_trivial/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2010-03-23 Paolo Carlini // // Copyright (C) 2010-2013 Free Software Foundation, Inc. @@ -19,24 +21,16 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_trivial; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); -} + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_trivially_destructible/value.cc b/libstdc++-v3/testsuite/20_util/is_trivially_destructible/value.cc index 0d9e7d31c94c..23c64c476ab4 100644 --- a/libstdc++-v3/testsuite/20_util/is_trivially_destructible/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_trivially_destructible/value.cc @@ -1,4 +1,5 @@ // { dg-options "-std=gnu++11" } +// { dg-do compile } // // 2012-04-15 Paolo Carlini // @@ -20,25 +21,17 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_trivially_destructible; using namespace __gnu_test; - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc b/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc index 9cf89776d1ac..7c9fea3c9b84 100644 --- a/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_unsigned/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2005-01-24 Paolo Carlini // // Copyright (C) 2005-2013 Free Software Foundation, Inc. @@ -19,52 +21,45 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::is_unsigned; using namespace __gnu_test; + + static_assert(test_category(false), ""); - VERIFY( (test_category(false)) ); - - VERIFY( (test_category(char(-1) > char(0))) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(char(-1) > char(0)), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); #ifdef _GLIBCXX_USE_WCHAR_T - VERIFY( (test_category(wchar_t(-1) > wchar_t(0))) ); + static_assert(test_category + (wchar_t(-1) > wchar_t(0)), ""); #endif - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(true)) ); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); + static_assert(test_category(true), ""); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); + static_assert(test_category(false), ""); // GNU Extensions. #ifdef _GLIBCXX_USE_INT128 - VERIFY( (test_category(true)) ); - VERIFY( (test_category(false)) ); + static_assert(test_category(true), ""); + static_assert(test_category(false), ""); #endif #ifdef _GLIBCXX_USE_FLOAT128 - VERIFY( (test_category(false)) ); + static_assert(test_category(false), ""); #endif // Sanity check. - VERIFY( (test_category(false)) ); -} - -int main() -{ - test01(); - return 0; + static_assert(test_category(false), ""); } diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc index 012e2e32dc7d..86097bb70ecc 100644 --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc @@ -1,5 +1,6 @@ // { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" } // { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux-* } } +// { dg-do compile } // 2007-05-03 Benjamin Kosnik // @@ -21,53 +22,46 @@ // . #include -#include // Ensure that this enum has "short" as its underlying type. enum test_enum { first_selection = ((unsigned char)-1) + 1 }; void test01() { - bool test __attribute__((unused)) = true; using std::make_signed; using std::is_same; // Positive tests. typedef make_signed::type test2_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_signed::type test21c_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_signed::type test21v_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_signed::type test21cv_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_signed::type test22_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #ifdef _GLIBCXX_USE_WCHAR_T typedef make_signed::type test23_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #endif typedef make_signed::type test24_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); // GNU Extensions. #ifdef _GLIBCXX_USE_INT128 typedef make_signed::type test25_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_signed<__int128>::type test26_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #endif } - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc index 57474b5b0851..e6d66dcf9bea 100644 --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-1.cc @@ -1,4 +1,5 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } // 2007-05-03 Benjamin Kosnik // @@ -20,56 +21,49 @@ // . #include -#include enum test_enum { first_selection }; void test01() { - bool test __attribute__((unused)) = true; using std::make_unsigned; using std::is_same; using std::is_unsigned; // Positive tests. typedef make_unsigned::type test2_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test21c_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test21v_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test21cv_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test22_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #ifdef _GLIBCXX_USE_WCHAR_T typedef make_unsigned::type test23_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #endif // Chapter 48, chapter 20. Smallest rank such that new unsigned type // same size. typedef make_unsigned::type test24_type; - VERIFY( is_unsigned::value ); - VERIFY( sizeof(test24_type) == sizeof(test_enum) ); + static_assert(is_unsigned::value, ""); + static_assert(sizeof(test24_type) == sizeof(test_enum), ""); // GNU Extensions. #ifdef _GLIBCXX_USE_INT128 typedef make_unsigned::type test25_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned<__int128>::type test26_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #endif } - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc index da83d974d7c6..41119be1fbbb 100644 --- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc +++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc @@ -1,5 +1,6 @@ -// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" } -// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux-* } } +// { dg-options "-std=gnu++11 -funsigned-char -fshort-enums" } +// { dg-options "-std=gnu++11 -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux-* } } +// { dg-do compile } // 2007-05-03 Benjamin Kosnik // @@ -21,53 +22,46 @@ // . #include -#include // Ensure that this enum has "short" as its underlying type. enum test_enum { first_selection = ((unsigned char)-1) + 1 }; void test01() { - bool test __attribute__((unused)) = true; using std::make_unsigned; using std::is_same; // Positive tests. typedef make_unsigned::type test2_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test21c_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test21v_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test21cv_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned::type test22_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #ifdef _GLIBCXX_USE_WCHAR_T typedef make_unsigned::type test23_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #endif typedef make_unsigned::type test24_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); // GNU Extensions. #ifdef _GLIBCXX_USE_INT128 typedef make_unsigned::type test25_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); typedef make_unsigned<__int128>::type test26_type; - VERIFY( (is_same::value) ); + static_assert(is_same::value, ""); #endif } - -int main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/20_util/remove_reference/value.cc b/libstdc++-v3/testsuite/20_util/remove_reference/value.cc index 0210dfad1de4..b66d27ee104c 100644 --- a/libstdc++-v3/testsuite/20_util/remove_reference/value.cc +++ b/libstdc++-v3/testsuite/20_util/remove_reference/value.cc @@ -1,4 +1,6 @@ -// { dg-options "-std=gnu++0x" } +// { dg-options "-std=gnu++11" } +// { dg-do compile } + // 2007-06-02 Paolo Carlini // // Copyright (C) 2007-2013 Free Software Foundation, Inc. @@ -19,34 +21,34 @@ // . #include -#include #include void test01() { - bool test __attribute__((unused)) = true; using std::remove_reference; using std::is_same; using namespace __gnu_test; - VERIFY( (is_same::type, int>::value) ); - VERIFY( (is_same::type, int>::value) ); - VERIFY( (is_same::type, const int>::value) ); - VERIFY( (is_same::type, int*>::value) ); - VERIFY( (is_same::type, ClassType>::value) ); - VERIFY( (is_same::type, ClassType>::value) ); - VERIFY( (is_same::type, int(int)>::value) ); - VERIFY( (is_same::type, int>::value) ); - VERIFY( (is_same::type, int>::value) ); - VERIFY( (is_same::type, const int>::value) ); - VERIFY( (is_same::type, int*>::value) ); - VERIFY( (is_same::type, ClassType>::value) ); - VERIFY( (is_same::type, ClassType>::value) ); - VERIFY( (is_same::type, int(int)>::value) ); -} - -int main() -{ - test01(); - return 0; + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, + const int>::value, ""); + static_assert(is_same::type, int*>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + int(int)>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, int>::value, ""); + static_assert(is_same::type, + const int>::value, ""); + static_assert(is_same::type, int*>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + ClassType>::value, ""); + static_assert(is_same::type, + int(int)>::value, ""); } diff --git a/libstdc++-v3/testsuite/util/testsuite_tr1.h b/libstdc++-v3/testsuite/util/testsuite_tr1.h index b0d6e8c2f58e..60d95ec6f0ca 100644 --- a/libstdc++-v3/testsuite/util/testsuite_tr1.h +++ b/libstdc++-v3/testsuite/util/testsuite_tr1.h @@ -28,66 +28,68 @@ namespace __gnu_test { // For tr1/type_traits. template class Category, typename Type> +#if __cplusplus >= 201103L + constexpr +#endif bool test_category(bool value) { - bool ret = true; - ret &= Category::value == value; - ret &= Category::value == value; - ret &= Category::value == value; - ret &= Category::value == value; - ret &= Category::type::value == value; - ret &= Category::type::value == value; - ret &= Category::type::value == value; - ret &= Category::type::value == value; - return ret; + return (Category::value == value + && Category::value == value + && Category::value == value + && Category::value == value + && Category::type::value == value + && Category::type::value == value + && Category::type::value == value + && Category::type::value == value); } template class Property, typename Type> +#if __cplusplus >= 201103L + constexpr +#endif bool test_property(typename Property::value_type value) { - bool ret = true; - ret &= Property::value == value; - ret &= Property::type::value == value; - return ret; + return (Property::value == value + && Property::type::value == value); } // For testing tr1/type_traits/extent, which has a second template // parameter. template class Property, typename Type, unsigned Uint> +#if __cplusplus >= 201103L + constexpr +#endif bool test_property(typename Property::value_type value) { - bool ret = true; - ret &= Property::value == value; - ret &= Property::type::value == value; - return ret; + return (Property::value == value + && Property::type::value == value); } #if __cplusplus >= 201103L template class Property, typename Type1, typename... Types> - bool + constexpr bool test_property(typename Property::value_type value) { - bool ret = true; - ret &= Property::value == value; - ret &= Property::type::value == value; - return ret; + return (Property::value == value + && Property::type::value == value); } #endif template class Relationship, typename Type1, typename Type2> +#if __cplusplus >= 201103L + constexpr +#endif bool test_relationship(bool value) { - bool ret = true; - ret &= Relationship::value == value; - ret &= Relationship::type::value == value; - return ret; + return (Relationship::value == value + && Relationship::type::value == value); } // Test types.