From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/add_const/value.cc | 53 +++++++++++ .../add_cv/requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/add_cv/value.cc | 56 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/add_pointer/value.cc | 45 +++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/add_reference/value.cc | 48 ++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/add_volatile/value.cc | 55 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/aligned_storage/value.cc | 62 +++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../alignment_of/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/alignment_of/value.cc | 44 +++++++++ .../extent/requirements/explicit_instantiation.cc | 33 +++++++ .../extent/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/extent/value.cc | 56 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../has_nothrow_assign/requirements/typedefs.cc | 35 +++++++ .../4_metaprogramming/has_nothrow_assign/value.cc | 54 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../requirements/typedefs.cc | 35 +++++++ .../has_nothrow_constructor/value.cc | 57 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../has_nothrow_copy/requirements/typedefs.cc | 35 +++++++ .../4_metaprogramming/has_nothrow_copy/value.cc | 54 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../has_trivial_assign/requirements/typedefs.cc | 35 +++++++ .../4_metaprogramming/has_trivial_assign/value.cc | 54 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../requirements/typedefs.cc | 35 +++++++ .../has_trivial_constructor/value.cc | 57 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../has_trivial_copy/requirements/typedefs.cc | 35 +++++++ .../4_metaprogramming/has_trivial_copy/value.cc | 54 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../requirements/typedefs.cc | 35 +++++++ .../has_trivial_destructor/value.cc | 57 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../requirements/typedefs.cc | 35 +++++++ .../has_virtual_destructor/value.cc | 55 +++++++++++ .../headers/type_traits/synopsis.cc | 103 +++++++++++++++++++++ .../headers/type_traits/types_std_tr1.cc | 26 ++++++ .../requirements/constexpr_data.cc | 52 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../integral_constant/requirements/typedefs.cc | 35 +++++++ .../integral_constant/static_definition.cc | 36 +++++++ .../integral_constant/true_false_type_typedefs.cc | 42 +++++++++ .../integral_constant/true_false_value.cc | 41 ++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_abstract/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_abstract/value.cc | 48 ++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_arithmetic/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_arithmetic/value.cc | 60 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_array/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_array/value.cc | 53 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_base_of/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_base_of/value.cc | 93 +++++++++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_class/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_class/value.cc | 60 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_compound/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_compound/value.cc | 59 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_const/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_const/value.cc | 49 ++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_convertible/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_convertible/value.cc | 86 +++++++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_empty/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_empty/value.cc | 75 +++++++++++++++ .../tr1/4_metaprogramming/is_enum/24808.cc | 40 ++++++++ .../is_enum/requirements/explicit_instantiation.cc | 33 +++++++ .../is_enum/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_enum/value.cc | 58 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_floating_point/requirements/typedefs.cc | 35 +++++++ .../4_metaprogramming/is_floating_point/value.cc | 60 ++++++++++++ .../tr1/4_metaprogramming/is_function/24808.cc | 40 ++++++++ .../tr1/4_metaprogramming/is_function/35637.cc | 34 +++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_function/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_function/value.cc | 54 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_fundamental/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_fundamental/value.cc | 59 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_integral/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_integral/value.cc | 61 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../requirements/typedefs.cc | 35 +++++++ .../is_member_function_pointer/value.cc | 60 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../requirements/typedefs.cc | 35 +++++++ .../is_member_object_pointer/value.cc | 60 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_member_pointer/requirements/typedefs.cc | 35 +++++++ .../4_metaprogramming/is_member_pointer/value.cc | 55 +++++++++++ .../tr1/4_metaprogramming/is_object/24808.cc | 40 ++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_object/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_object/value.cc | 49 ++++++++++ .../is_pod/requirements/explicit_instantiation.cc | 33 +++++++ .../is_pod/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_pod/value.cc | 54 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_pointer/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_pointer/value.cc | 44 +++++++++ .../tr1/4_metaprogramming/is_polymorphic/24809.cc | 26 ++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_polymorphic/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_polymorphic/value.cc | 54 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_reference/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_reference/value.cc | 44 +++++++++ .../is_same/requirements/explicit_instantiation.cc | 33 +++++++ .../is_same/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_same/value.cc | 49 ++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_scalar/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_scalar/value.cc | 48 ++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_signed/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_signed/value.cc | 61 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_union/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_union/value.cc | 60 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_unsigned/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_unsigned/value.cc | 61 ++++++++++++ .../is_void/requirements/explicit_instantiation.cc | 33 +++++++ .../is_void/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_void/value.cc | 60 ++++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../is_volatile/requirements/typedefs.cc | 35 +++++++ .../tr1/4_metaprogramming/is_volatile/value.cc | 49 ++++++++++ .../rank/requirements/explicit_instantiation.cc | 33 +++++++ .../rank/requirements/typedefs.cc | 35 +++++++ .../testsuite/tr1/4_metaprogramming/rank/value.cc | 46 +++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../4_metaprogramming/remove_all_extents/value.cc | 53 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/remove_const/value.cc | 46 +++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/remove_cv/value.cc | 46 +++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/remove_extent/value.cc | 52 +++++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/remove_pointer/value.cc | 45 +++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../4_metaprogramming/remove_reference/value.cc | 45 +++++++++ .../requirements/explicit_instantiation.cc | 33 +++++++ .../tr1/4_metaprogramming/remove_volatile/value.cc | 47 ++++++++++ 159 files changed, 6621 insertions(+) create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/synopsis.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/types_std_tr1.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/static_definition.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_type_typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/24808.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/24808.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/35637.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/24808.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/24809.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/typedefs.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/value.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/requirements/explicit_instantiation.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/value.cc (limited to 'libstdc++-v3/testsuite/tr1/4_metaprogramming') diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..6f8ba791e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_const; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc new file mode 100644 index 000000000..213db8806 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_const/value.cc @@ -0,0 +1,53 @@ +// 2004-12-16 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.1 Const-volatile modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_const; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same::type, const int>::value) ); + VERIFY( (is_same::type, const volatile int>::value) ); + VERIFY( (is_same::type, int* const>::value) ); + VERIFY( (is_same::type, int&>::value) ); + VERIFY( (is_same::type, int (int)>::value) ); + VERIFY( (is_same::type, const int>::value) ); + VERIFY( (is_same::type, const ClassType>::value) ); + VERIFY( (is_same::type, + const volatile ClassType>::value) ); + VERIFY( (is_same::type, ClassType* const>::value) ); + VERIFY( (is_same::type, ClassType&>::value) ); + VERIFY( (is_same::type, + ClassType (ClassType)>::value) ); + VERIFY( (is_same::type, const ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bb2f16bca --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_cv; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc new file mode 100644 index 000000000..d7c9346c9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_cv/value.cc @@ -0,0 +1,56 @@ +// 2004-12-16 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.1 Const-volatile modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_cv; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same::type, const volatile int>::value) ); + VERIFY( (is_same::type, const volatile int>::value) ); + VERIFY( (is_same::type, int* const volatile>::value) ); + VERIFY( (is_same::type, int&>::value) ); + VERIFY( (is_same::type, int (int)>::value) ); + VERIFY( (is_same::type, + const volatile int>::value) ); + VERIFY( (is_same::type, const volatile ClassType>::value) ); + VERIFY( (is_same::type, + const volatile ClassType>::value) ); + VERIFY( (is_same::type, + ClassType* const volatile>::value) ); + VERIFY( (is_same::type, ClassType&>::value) ); + VERIFY( (is_same::type, + ClassType (ClassType)>::value) ); + VERIFY( (is_same::type, + const volatile ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..3755bd7f9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_pointer; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc new file mode 100644 index 000000000..930863636 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_pointer/value.cc @@ -0,0 +1,45 @@ +// 2004-12-12 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.2 Reference modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_pointer; + using std::tr1::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) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bd0ca275d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_reference; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc new file mode 100644 index 000000000..2ff989303 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_reference/value.cc @@ -0,0 +1,48 @@ +// 2004-12-08 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.2 Reference modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_reference; + using std::tr1::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, void>::value) ); + VERIFY( (is_same::type, const void>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..f068cb942 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct add_volatile; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc new file mode 100644 index 000000000..64e4a7f5a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/add_volatile/value.cc @@ -0,0 +1,55 @@ +// 2004-12-16 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.1 Const-volatile modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::add_volatile; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same::type, volatile int>::value) ); + VERIFY( (is_same::type, const volatile int>::value) ); + VERIFY( (is_same::type, int* volatile>::value) ); + VERIFY( (is_same::type, int&>::value) ); + VERIFY( (is_same::type, int (int)>::value) ); + VERIFY( (is_same::type, volatile int>::value) ); + VERIFY( (is_same::type, volatile ClassType>::value) ); + VERIFY( (is_same::type, + const volatile ClassType>::value) ); + VERIFY( (is_same::type, + ClassType* volatile>::value) ); + VERIFY( (is_same::type, ClassType&>::value) ); + VERIFY( (is_same::type, + ClassType (ClassType)>::value) ); + VERIFY( (is_same::type, + volatile ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..7c7911811 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct aligned_storage<1, alignment_of::value>; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc new file mode 100644 index 000000000..1e933ef99 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/aligned_storage/value.cc @@ -0,0 +1,62 @@ +// 2005-01-11 Paolo Carlini +// +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.8 Other transformations + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::aligned_storage; + using std::tr1::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) ); + + 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) ); + + 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) ); + + 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) ); + + 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) ); + + 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) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..a533645cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct alignment_of; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/typedefs.cc new file mode 100644 index 000000000..b8ed9671c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-11 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::alignment_of test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/value.cc new file mode 100644 index 000000000..234d76f81 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/alignment_of/value.cc @@ -0,0 +1,44 @@ +// 2005-01-11 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::alignment_of; + using namespace __gnu_test; + + VERIFY( (test_property(__alignof__(char))) ); + VERIFY( (test_property(__alignof__(short))) ); + VERIFY( (test_property(__alignof__(int))) ); + VERIFY( (test_property(__alignof__(double))) ); + VERIFY( (test_property(__alignof__(int[4]))) ); + VERIFY( (test_property(__alignof__(ClassType))) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..03e6520e1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct extent; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/typedefs.cc new file mode 100644 index 000000000..978c8b68a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-12 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::extent test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/value.cc new file mode 100644 index 000000000..d7127aa3c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/extent/value.cc @@ -0,0 +1,56 @@ +// 2004-12-12 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::extent; + using namespace __gnu_test; + + VERIFY( (test_property(0)) ); + VERIFY( (test_property(2)) ); + VERIFY( (test_property(2)) ); + VERIFY( (test_property(0)) ); + VERIFY( (extent::value == 0) ); + VERIFY( (extent::value == 0) ); + VERIFY( (extent::value == 4) ); + VERIFY( (extent::value == 4) ); + VERIFY( (extent::value == 12) ); + VERIFY( (test_property(0)) ); + VERIFY( (test_property(2)) ); + VERIFY( (test_property(2)) ); + VERIFY( (test_property(0)) ); + VERIFY( (extent::value == 0) ); + VERIFY( (extent::value == 0) ); + VERIFY( (extent::value == 4) ); + VERIFY( (extent::value == 4) ); + VERIFY( (extent::value == 12) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..ee6140a83 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_nothrow_assign; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/typedefs.cc new file mode 100644 index 000000000..4175eae82 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_nothrow_assign test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/value.cc new file mode 100644 index 000000000..478f5e10c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_assign/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_nothrow_assign; + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..5686cff40 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_nothrow_constructor; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/typedefs.cc new file mode 100644 index 000000000..85fd577f9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-29 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_nothrow_constructor test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/value.cc new file mode 100644 index 000000000..d6810d3ac --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_constructor/value.cc @@ -0,0 +1,57 @@ +// 2004-12-29 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_nothrow_constructor; + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dc07be0d9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_nothrow_copy; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/typedefs.cc new file mode 100644 index 000000000..7a05eeb14 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_nothrow_copy test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/value.cc new file mode 100644 index 000000000..01a37ec17 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_nothrow_copy/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_nothrow_copy; + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..d63d9726b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_assign; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/typedefs.cc new file mode 100644 index 000000000..d010f95b0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_assign test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/value.cc new file mode 100644 index 000000000..6804c1e5b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_assign/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_assign; + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..9d3345864 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_constructor; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/typedefs.cc new file mode 100644 index 000000000..ac46b1649 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-26 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_constructor test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/value.cc new file mode 100644 index 000000000..e9e8aca83 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_constructor/value.cc @@ -0,0 +1,57 @@ +// 2004-12-26 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_constructor; + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..a50bcaa13 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_copy; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/typedefs.cc new file mode 100644 index 000000000..6ede2f34d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_copy test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/value.cc new file mode 100644 index 000000000..005cefbde --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_copy/value.cc @@ -0,0 +1,54 @@ +// 2004-12-30 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_copy; + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..27e9fa6ec --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_trivial_destructor; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/typedefs.cc new file mode 100644 index 000000000..31719e2d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-26 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_trivial_destructor test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/value.cc new file mode 100644 index 000000000..c63b05040 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_trivial_destructor/value.cc @@ -0,0 +1,57 @@ +// 2004-12-26 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_trivial_destructor; + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bc41fc8e3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct has_virtual_destructor; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/typedefs.cc new file mode 100644 index 000000000..478673093 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::has_virtual_destructor test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/value.cc new file mode 100644 index 000000000..dcb490a91 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/has_virtual_destructor/value.cc @@ -0,0 +1,55 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::has_virtual_destructor; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (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)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/synopsis.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/synopsis.cc new file mode 100644 index 000000000..5f96f606c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/synopsis.cc @@ -0,0 +1,103 @@ +// { dg-do compile } + +// 2007-02-04 Benjamin Kosnik +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// . + +#include + +namespace std { +namespace tr1 { + + // [4.3] helper class: + template struct integral_constant; + typedef integral_constant true_type; + typedef integral_constant false_type; + + // [4.5.1] primary type categories: + template struct is_void; + template struct is_integral; + template struct is_floating_point; + template struct is_array; + template struct is_pointer; + template struct is_reference; + template struct is_member_object_pointer; + template struct is_member_function_pointer; + template struct is_enum; + template struct is_union; + template struct is_class; + template struct is_function; + + // [4.5.2] composite type categories: + template struct is_arithmetic; + template struct is_fundamental; + template struct is_object; + template struct is_scalar; + template struct is_compound; + template struct is_member_pointer; + + // [4.5.3] type properties: + template struct is_const; + template struct is_volatile; + template struct is_pod; + template struct is_empty; + template struct is_polymorphic; + template struct is_abstract; + template struct has_trivial_constructor; + template struct has_trivial_copy; + template struct has_trivial_assign; + template struct has_trivial_destructor; + template struct has_nothrow_constructor; + template struct has_nothrow_copy; + template struct has_nothrow_assign; + template struct has_virtual_destructor; + template struct is_signed; + template struct is_unsigned; + template struct alignment_of; + template struct rank; + template struct extent; + + // [4.6] type relations: + template struct is_same; + template struct is_base_of; + template struct is_convertible; + + // [4.7.1] const-volatile modifications: + template struct remove_const; + template struct remove_volatile; + template struct remove_cv; + template struct add_const; + template struct add_volatile; + template struct add_cv; + + // [4.7.2] reference modifications: + template struct remove_reference; + template struct add_reference; + + // [4.7.3] array modifications: + template struct remove_extent; + template struct remove_all_extents; + + // [4.7.4] pointer modifications: + template struct remove_pointer; + template struct add_pointer; + + // [4.8] other transformations: + template struct aligned_storage; +} // namespace tr1 +} // namespace std diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/types_std_tr1.cc new file mode 100644 index 000000000..0d478f544 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/headers/type_traits/types_std_tr1.cc @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +namespace gnu +{ + using std::tr1::true_type; + using std::tr1::false_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc new file mode 100644 index 000000000..52497e1f4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc @@ -0,0 +1,52 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v __attribute__((unused)) (_Ttesttype::value); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + test.operator()>(); + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..2b60f5318 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct integral_constant; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/typedefs.cc new file mode 100644 index 000000000..89fd5c268 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::integral_constant test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/static_definition.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/static_definition.cc new file mode 100644 index 000000000..c1da4f8ee --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/static_definition.cc @@ -0,0 +1,36 @@ +// 2006-05-07 Paolo Carlini +// +// Copyright (C) 2006, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.3 Helper classes + +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + const bool* p = &std::tr1::integral_constant::value; + VERIFY( p ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_type_typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_type_typedefs.cc new file mode 100644 index 000000000..94f2fa4aa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_type_typedefs.cc @@ -0,0 +1,42 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::true_type true_type; + typedef std::tr1::false_type false_type; + + typedef true_type::value_type true_value_type; + typedef true_type::type true_type; + typedef true_type::type::value_type true_type_value_type; + typedef true_type::type::type true_type_type; + + typedef false_type::value_type false_value_type; + typedef false_type::type false_type; + typedef false_type::type::value_type false_type_value_type; + typedef false_type::type::type false_type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_value.cc new file mode 100644 index 000000000..1d5e25d9a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/true_false_value.cc @@ -0,0 +1,41 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.3 Helper classes + +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::true_type; + using std::tr1::false_type; + + VERIFY( true_type::value == true ); + VERIFY( false_type::value == false ); + VERIFY( true_type::type::value == true ); + VERIFY( false_type::type::value == false ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..3df8b61fa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_abstract; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/typedefs.cc new file mode 100644 index 000000000..ff6bc501c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-28 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_abstract test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/value.cc new file mode 100644 index 000000000..14c0bbffa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_abstract/value.cc @@ -0,0 +1,48 @@ +// 2005-01-28 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_abstract; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + + // Negative tests. + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..c8f9d9639 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_arithmetic; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/typedefs.cc new file mode 100644 index 000000000..10bbb38eb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_arithmetic test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc new file mode 100644 index 000000000..dfed8e40d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_arithmetic/value.cc @@ -0,0 +1,60 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.2 Composite type traits + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_arithmetic; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..c518792b4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_array; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/typedefs.cc new file mode 100644 index 000000000..ec08cdd1f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_array test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/value.cc new file mode 100644 index 000000000..cf3b70ce7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_array/value.cc @@ -0,0 +1,53 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_array; + 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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..9770f09e6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_base_of; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/typedefs.cc new file mode 100644 index 000000000..51499d746 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-03-04 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_base_of test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/value.cc new file mode 100644 index 000000000..fa7bc8074 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_base_of/value.cc @@ -0,0 +1,93 @@ +// 2005-03-04 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.6 Relationships between types + +#include +#include +#include + +class HiddenCons +{ + HiddenCons(); + HiddenCons(const HiddenCons&); +}; + +class DerivedHiddenCons +: private HiddenCons +{ + DerivedHiddenCons(); + DerivedHiddenCons(const DerivedHiddenCons&); +}; + +class MultiDerivedHiddenCons +: private HiddenCons, private __gnu_test::ClassType +{ + MultiDerivedHiddenCons(); + MultiDerivedHiddenCons(const MultiDerivedHiddenCons&); +}; + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_base_of; + 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)) ); + + // 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..4a372bf46 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_class; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/typedefs.cc new file mode 100644 index 000000000..9ed7f2386 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_class test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/value.cc new file mode 100644 index 000000000..1fe8fe100 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_class/value.cc @@ -0,0 +1,60 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_class; + 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)) ); + + // 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..4d6b10c48 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_compound; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/typedefs.cc new file mode 100644 index 000000000..b5bb750b5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-11 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_compound test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/value.cc new file mode 100644 index 000000000..69992f1d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_compound/value.cc @@ -0,0 +1,59 @@ +// 2004-12-11 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.2 Composite type traits + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_compound; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (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)) ); + + // Sanity check. + VERIFY( (test_category(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..2c7d72574 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_const; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/typedefs.cc new file mode 100644 index 000000000..ee4b1817a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-07 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_const test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/value.cc new file mode 100644 index 000000000..2f6bd135f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_const/value.cc @@ -0,0 +1,49 @@ +// 2004-12-07 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_const; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..c1481c586 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_convertible; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/typedefs.cc new file mode 100644 index 000000000..a75506b84 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-02-23 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_convertible test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/value.cc new file mode 100644 index 000000000..9a677ec11 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_convertible/value.cc @@ -0,0 +1,86 @@ +// 2005-02-23 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.6 Relationships between types + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::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)) ); + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + VERIFY( (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)) ); + + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dc52336a3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_empty; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/typedefs.cc new file mode 100644 index 000000000..876c576c0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-28 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_empty test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/value.cc new file mode 100644 index 000000000..d2980510b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_empty/value.cc @@ -0,0 +1,75 @@ +// 2005-01-28 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +class EmptyClassOne +{ typedef int type; }; + +class EmptyClassTwo +{ static int data; }; + +class EmptyClassThree +{ int f(); }; + +class NonEmptyClassOne +{ int data; }; + +class NonEmptyClassTwo +{ + virtual int f(); + virtual ~NonEmptyClassTwo(); +}; + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_empty; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (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)) ); + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/24808.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/24808.cc new file mode 100644 index 000000000..b59e826d6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/24808.cc @@ -0,0 +1,40 @@ +// 2005-11-11 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_enum; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..fd962fabe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_enum; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/typedefs.cc new file mode 100644 index 000000000..4fe26b8a7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-25 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_enum test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/value.cc new file mode 100644 index 000000000..ccacfd94d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_enum/value.cc @@ -0,0 +1,58 @@ +// 2004-12-25 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_enum; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (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)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(false)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0ca78b427 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_floating_point; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/typedefs.cc new file mode 100644 index 000000000..471fdd472 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_floating_point test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/value.cc new file mode 100644 index 000000000..e227cf45b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_floating_point/value.cc @@ -0,0 +1,60 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_floating_point; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/24808.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/24808.cc new file mode 100644 index 000000000..b57161fa3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/24808.cc @@ -0,0 +1,40 @@ +// 2005-11-11 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_function; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/35637.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/35637.cc new file mode 100644 index 000000000..efd5db402 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/35637.cc @@ -0,0 +1,34 @@ +// { dg-options "-pedantic-errors" } +// { dg-do compile } + +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include + +struct S +{ + void F() const {} +}; + +// libstdc++/35637 +void test01() +{ + std::tr1::function a(&S::F); +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..d15ac23cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_function; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/typedefs.cc new file mode 100644 index 000000000..5503e1f88 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-16 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_function test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/value.cc new file mode 100644 index 000000000..30e26d768 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_function/value.cc @@ -0,0 +1,54 @@ +// 2004-12-16 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_function; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dcecc44d8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_fundamental; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/typedefs.cc new file mode 100644 index 000000000..116afebf8 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_fundamental test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/value.cc new file mode 100644 index 000000000..f2e2c4ade --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_fundamental/value.cc @@ -0,0 +1,59 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.2 Composite type traits + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_fundamental; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..f806cf39b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_integral; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/typedefs.cc new file mode 100644 index 000000000..92601999e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_integral test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/value.cc new file mode 100644 index 000000000..9cd4ef801 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_integral/value.cc @@ -0,0 +1,61 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_integral; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (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(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..02d470305 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_member_function_pointer; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..39083321e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-24 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_member_function_pointer test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/value.cc new file mode 100644 index 000000000..ef6bd9980 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_function_pointer/value.cc @@ -0,0 +1,60 @@ +// 2004-12-24 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::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)) ); + + // Negative tests. + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..6f92ba189 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_member_object_pointer; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..823a701eb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-24 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_member_object_pointer test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/value.cc new file mode 100644 index 000000000..34871e452 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_object_pointer/value.cc @@ -0,0 +1,60 @@ +// 2004-12-24 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_member_object_pointer; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..99d1222c7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_member_pointer; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..1f8df3856 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-24 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_member_pointer test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/value.cc new file mode 100644 index 000000000..37db405f1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_member_pointer/value.cc @@ -0,0 +1,55 @@ +// 2004-12-24 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.2 Composite type traits + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_member_pointer; + 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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/24808.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/24808.cc new file mode 100644 index 000000000..50cd97dd6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/24808.cc @@ -0,0 +1,40 @@ +// 2005-11-11 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.2 Composite type traits + +#include +#include +#include + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_object; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..2bb025b5c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_object; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/typedefs.cc new file mode 100644 index 000000000..31c526b3f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-16 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_object test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/value.cc new file mode 100644 index 000000000..a3c954d8d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_object/value.cc @@ -0,0 +1,49 @@ +// 2004-12-16 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.2 Composite type traits + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::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)) ); + + // Sanity check. + VERIFY( (test_category(true)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..97de6aa1b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_pod; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/typedefs.cc new file mode 100644 index 000000000..22950c3aa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-26 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_pod test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/value.cc new file mode 100644 index 000000000..6cf88c922 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pod/value.cc @@ -0,0 +1,54 @@ +// 2004-12-26 Paolo Carlini +// +// Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..fd820d557 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_pointer; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/typedefs.cc new file mode 100644 index 000000000..806ee5738 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-12 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_pointer test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/value.cc new file mode 100644 index 000000000..e4a7e3cd2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_pointer/value.cc @@ -0,0 +1,44 @@ +// 2004-12-12 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_pointer; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/24809.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/24809.cc new file mode 100644 index 000000000..7c479344a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/24809.cc @@ -0,0 +1,26 @@ +// { dg-do compile } + +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include + +// libstdc++/24809 +static const bool b = std::tr1::is_polymorphic::value; diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..890fa0db3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_polymorphic; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/typedefs.cc new file mode 100644 index 000000000..cb612f99f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-03-03 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_polymorphic test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/value.cc new file mode 100644 index 000000000..c73c2d6f9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_polymorphic/value.cc @@ -0,0 +1,54 @@ +// 2005-03-03 Paolo Carlini +// +// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_polymorphic; + 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)) ); + + // 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..cf141a364 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_reference; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/typedefs.cc new file mode 100644 index 000000000..e64db083a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-06 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_reference test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/value.cc new file mode 100644 index 000000000..6eae838dd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_reference/value.cc @@ -0,0 +1,44 @@ +// 2004-12-06 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_reference; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..8a862e736 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_same; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/typedefs.cc new file mode 100644 index 000000000..5adb7a159 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-08 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_same test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/value.cc new file mode 100644 index 000000000..b98754ad9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_same/value.cc @@ -0,0 +1,49 @@ +// 2004-12-08 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.6 Relationships between types + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_same; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + + // Negative tests. + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); + VERIFY( (test_relationship(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..bf127cf2d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_scalar; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/typedefs.cc new file mode 100644 index 000000000..2513a20dc --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-25 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_scalar test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/value.cc new file mode 100644 index 000000000..567b6d9b2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_scalar/value.cc @@ -0,0 +1,48 @@ +// 2004-12-25 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.2 Composite type traits + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..db5fbe48d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_signed; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/typedefs.cc new file mode 100644 index 000000000..27f319317 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-24 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_signed test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/value.cc new file mode 100644 index 000000000..e19a1eac2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_signed/value.cc @@ -0,0 +1,61 @@ +// 2005-01-24 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_signed; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category(false)) ); +#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)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..7e9e6ea4f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_union; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/typedefs.cc new file mode 100644 index 000000000..0d352765c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_union test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/value.cc new file mode 100644 index 000000000..90ace4937 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_union/value.cc @@ -0,0 +1,60 @@ +// 2007-04-08 Paolo Carlini +// +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_union; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (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)) ); + 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)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..da382cdbe --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_unsigned; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/typedefs.cc new file mode 100644 index 000000000..381a15d59 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2005-01-24 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_unsigned test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/value.cc new file mode 100644 index 000000000..991d9cf6d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_unsigned/value.cc @@ -0,0 +1,61 @@ +// 2005-01-24 Paolo Carlini +// +// Copyright (C) 2005, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_unsigned; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(true)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (test_category(false)) ); +#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)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..3dcb5da73 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_void; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/typedefs.cc new file mode 100644 index 000000000..c3c005036 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_void test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/value.cc new file mode 100644 index 000000000..76676c322 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_void/value.cc @@ -0,0 +1,60 @@ +// 2004-12-03 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.1 Primary type categories + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_void; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); +#ifdef _GLIBCXX_USE_WCHAR_T + VERIFY( (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)) ); + + // Sanity check. + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..d09b08b7c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct is_volatile; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/typedefs.cc new file mode 100644 index 000000000..b52b5dae5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-07 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::is_volatile test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/value.cc new file mode 100644 index 000000000..3453c6e0f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/is_volatile/value.cc @@ -0,0 +1,49 @@ +// 2004-12-07 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::is_volatile; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + VERIFY( (test_property(true)) ); + + // Negative tests. + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); + VERIFY( (test_property(false)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..f3aa7f658 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct rank; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/typedefs.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/typedefs.cc new file mode 100644 index 000000000..74982f1e6 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/requirements/typedefs.cc @@ -0,0 +1,35 @@ +// 2004-12-11 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// +// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES. + +#include + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::tr1::rank test_type; + typedef test_type::value_type value_type; + typedef test_type::type type; + typedef test_type::type::value_type type_value_type; + typedef test_type::type::type type_type; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/value.cc new file mode 100644 index 000000000..ff001ec96 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/rank/value.cc @@ -0,0 +1,46 @@ +// 2004-12-11 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.5.3 Type properties + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::rank; + using namespace __gnu_test; + + VERIFY( (test_property(0)) ); + VERIFY( (test_property(1)) ); + VERIFY( (test_property(2)) ); + VERIFY( (test_property(6)) ); + VERIFY( (test_property(0)) ); + VERIFY( (test_property(1)) ); + VERIFY( (test_property(2)) ); + VERIFY( (test_property(6)) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..0dc8510f0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_all_extents; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/value.cc new file mode 100644 index 000000000..eb97b7274 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_all_extents/value.cc @@ -0,0 +1,53 @@ +// 2004-12-09 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.3 Array modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_all_extents; + using std::tr1::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, int>::value) ); + VERIFY( (is_same::type, + const int>::value) ); + VERIFY( (is_same::type, ClassType>::value) ); + VERIFY( (is_same::type, ClassType>::value) ); + VERIFY( (is_same::type, + ClassType>::value) ); + VERIFY( (is_same::type, + ClassType>::value) ); + VERIFY( (is_same::type, + const ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..87fffe1bd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_const; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/value.cc new file mode 100644 index 000000000..f3ad1502e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_const/value.cc @@ -0,0 +1,46 @@ +// 2004-12-10 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.1 Const-volatile modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_const; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same::type, + volatile int>::value) ); + VERIFY( (is_same::type, const int*>::value) ); + VERIFY( (is_same::type, + volatile ClassType>::value) ); + VERIFY( (is_same::type, + const ClassType*>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..50a3dc551 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_cv; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/value.cc new file mode 100644 index 000000000..5e9f397cf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_cv/value.cc @@ -0,0 +1,46 @@ +// 2004-12-10 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.1 Const-volatile modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_cv; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same::type, int>::value) ); + VERIFY( (is_same::type, + const volatile int*>::value) ); + VERIFY( (is_same::type, + ClassType>::value) ); + VERIFY( (is_same::type, + const volatile ClassType*>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..dd15bcbe4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_extent; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/value.cc new file mode 100644 index 000000000..322aa2d89 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_extent/value.cc @@ -0,0 +1,52 @@ +// 2004-12-09 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.3 Array modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_extent; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same::type, int>::value) ); + VERIFY( (is_same::type, int>::value) ); + VERIFY( (is_same::type, int[3]>::value) ); + VERIFY( (is_same::type, int[3]>::value) ); + VERIFY( (is_same::type, const int>::value) ); + VERIFY( (is_same::type, ClassType>::value) ); + VERIFY( (is_same::type, ClassType>::value) ); + VERIFY( (is_same::type, + ClassType[3]>::value) ); + VERIFY( (is_same::type, + ClassType[3]>::value) ); + VERIFY( (is_same::type, + const ClassType>::value) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..aa19e24c2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_pointer; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/value.cc new file mode 100644 index 000000000..c6cf05332 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_pointer/value.cc @@ -0,0 +1,45 @@ +// 2004-12-12 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.2 Reference modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_pointer; + using std::tr1::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) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..778c75b57 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_reference; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/value.cc new file mode 100644 index 000000000..8ad89b2bb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_reference/value.cc @@ -0,0 +1,45 @@ +// 2004-12-08 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.2 Reference modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_reference; + using std::tr1::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) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/requirements/explicit_instantiation.cc new file mode 100644 index 000000000..4f39bd13d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/requirements/explicit_instantiation.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// 2007-04-30 Benjamin Kosnik + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NB: This file is for testing type_traits with NO OTHER INCLUDES. + +#include + +namespace std +{ + namespace tr1 + { + typedef short test_type; + template struct remove_volatile; + } +} diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/value.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/value.cc new file mode 100644 index 000000000..48d9876a0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/remove_volatile/value.cc @@ -0,0 +1,47 @@ +// 2004-12-10 Paolo Carlini +// +// Copyright (C) 2004, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 4.7.1 Const-volatile modifications + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::tr1::remove_volatile; + using std::tr1::is_same; + using namespace __gnu_test; + + VERIFY( (is_same::type, + const int>::value) ); + VERIFY( (is_same::type, + volatile int*>::value) ); + VERIFY( (is_same::type, + const ClassType>::value) ); + VERIFY( (is_same::type, + volatile ClassType*>::value) ); +} + +int main() +{ + test01(); + return 0; +} -- cgit v1.2.3