Index: include/std/type_traits =================================================================== --- include/std/type_traits (revision 172385) +++ include/std/type_traits (working copy) @@ -1,6 +1,6 @@ // C++0x type_traits -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011 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 @@ -51,22 +51,47 @@ typedef struct { char __arr[2]; } __two; }; -#define _DEFINE_SPEC_0_HELPER \ - template<> + // Meta programming helper types. -#define _DEFINE_SPEC_1_HELPER \ - template + template + struct conditional; -#define _DEFINE_SPEC_2_HELPER \ - template + template + struct integral_constant; -#define _DEFINE_SPEC(_Order, _Trait, _Type, _Value) \ - _DEFINE_SPEC_##_Order##_HELPER \ - struct _Trait<_Type> \ - : public integral_constant { }; + template + struct __or_; - // helper classes. + template + struct __or_<_B1, _B2> + : public conditional<_B1::value, _B1, _B2>::type + { }; + template + struct __or_<_B1, _B2, _B3, _Bn...> + : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type + { }; + + template + struct __and_; + + template + struct __and_<_B1, _B2> + : public conditional<_B1::value, _B2, _B1>::type + { }; + + template + struct __and_<_B1, _B2, _B3, _Bn...> + : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type + { }; + + template + struct __not_ + : public integral_constant + { }; + + // helper class. + /// integral_constant template struct integral_constant @@ -86,16 +111,18 @@ template constexpr _Tp integral_constant<_Tp, __v>::value; - /// remove_cv + // primary type categories. + template struct remove_cv; template struct __is_void_helper : public false_type { }; - _DEFINE_SPEC(0, __is_void_helper, void, true) - // primary type categories. + template<> + struct __is_void_helper + : public true_type { }; /// is_void template @@ -107,24 +134,69 @@ template struct __is_integral_helper : public false_type { }; - _DEFINE_SPEC(0, __is_integral_helper, bool, true) - _DEFINE_SPEC(0, __is_integral_helper, char, true) - _DEFINE_SPEC(0, __is_integral_helper, signed char, true) - _DEFINE_SPEC(0, __is_integral_helper, unsigned char, true) + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + #ifdef _GLIBCXX_USE_WCHAR_T - _DEFINE_SPEC(0, __is_integral_helper, wchar_t, true) + template<> + struct __is_integral_helper + : public true_type { }; #endif - _DEFINE_SPEC(0, __is_integral_helper, char16_t, true) - _DEFINE_SPEC(0, __is_integral_helper, char32_t, true) - _DEFINE_SPEC(0, __is_integral_helper, short, true) - _DEFINE_SPEC(0, __is_integral_helper, unsigned short, true) - _DEFINE_SPEC(0, __is_integral_helper, int, true) - _DEFINE_SPEC(0, __is_integral_helper, unsigned int, true) - _DEFINE_SPEC(0, __is_integral_helper, long, true) - _DEFINE_SPEC(0, __is_integral_helper, unsigned long, true) - _DEFINE_SPEC(0, __is_integral_helper, long long, true) - _DEFINE_SPEC(0, __is_integral_helper, unsigned long long, true) + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + + template<> + struct __is_integral_helper + : public true_type { }; + /// is_integral template struct is_integral @@ -135,10 +207,19 @@ template struct __is_floating_point_helper : public false_type { }; - _DEFINE_SPEC(0, __is_floating_point_helper, float, true) - _DEFINE_SPEC(0, __is_floating_point_helper, double, true) - _DEFINE_SPEC(0, __is_floating_point_helper, long double, true) + template<> + struct __is_floating_point_helper + : public true_type { }; + + template<> + struct __is_floating_point_helper + : public true_type { }; + + template<> + struct __is_floating_point_helper + : public true_type { }; + /// is_floating_point template struct is_floating_point @@ -162,8 +243,11 @@ template struct __is_pointer_helper : public false_type { }; - _DEFINE_SPEC(1, __is_pointer_helper, _Tp*, true) + template + struct __is_pointer_helper<_Tp*> + : public true_type { }; + /// is_pointer template struct is_pointer @@ -171,20 +255,35 @@ remove_cv<_Tp>::type>::value)> { }; - /// is_reference + /// is_lvalue_reference + template + struct is_lvalue_reference + : public false_type { }; + template - struct is_reference; + struct is_lvalue_reference<_Tp&> + : public true_type { }; - /// is_function + /// is_rvalue_reference + template + struct is_rvalue_reference + : public false_type { }; + template + struct is_rvalue_reference<_Tp&&> + : public true_type { }; + + template struct is_function; template struct __is_member_object_pointer_helper : public false_type { }; - _DEFINE_SPEC(2, __is_member_object_pointer_helper, _Tp _Cp::*, - !is_function<_Tp>::value) + template + struct __is_member_object_pointer_helper<_Tp _Cp::*> + : public integral_constant::value> { }; + /// is_member_object_pointer template struct is_member_object_pointer @@ -195,9 +294,11 @@ template struct __is_member_function_pointer_helper : public false_type { }; - _DEFINE_SPEC(2, __is_member_function_pointer_helper, _Tp _Cp::*, - is_function<_Tp>::value) + template + struct __is_member_function_pointer_helper<_Tp _Cp::*> + : public integral_constant::value> { }; + /// is_member_function_pointer template struct is_member_function_pointer @@ -227,27 +328,35 @@ template struct is_function : public false_type { }; + template struct is_function<_Res(_ArgTypes...)> : public true_type { }; + template struct is_function<_Res(_ArgTypes......)> : public true_type { }; + template struct is_function<_Res(_ArgTypes...) const> : public true_type { }; + template struct is_function<_Res(_ArgTypes......) const> : public true_type { }; + template struct is_function<_Res(_ArgTypes...) volatile> : public true_type { }; + template struct is_function<_Res(_ArgTypes......) volatile> : public true_type { }; + template struct is_function<_Res(_ArgTypes...) const volatile> : public true_type { }; + template struct is_function<_Res(_ArgTypes......) const volatile> : public true_type { }; @@ -255,8 +364,11 @@ template struct __is_nullptr_t_helper : public false_type { }; - _DEFINE_SPEC(0, __is_nullptr_t_helper, std::nullptr_t, true) + template<> + struct __is_nullptr_t_helper + : public true_type { }; + // __is_nullptr_t (extension). template struct __is_nullptr_t @@ -264,42 +376,42 @@ remove_cv<_Tp>::type>::value)> { }; - // composite type traits. - + // composite type categories. + + /// is_reference + template + struct is_reference + : public __or_, + is_rvalue_reference<_Tp>>::type + { }; + /// is_arithmetic template struct is_arithmetic - : public integral_constant::value - || is_floating_point<_Tp>::value)> + : public __or_, is_floating_point<_Tp>>::type { }; /// is_fundamental template struct is_fundamental - : public integral_constant::value - || is_void<_Tp>::value)> + : public __or_, is_void<_Tp>>::type { }; /// is_object template struct is_object - : public integral_constant::value - || is_reference<_Tp>::value - || is_void<_Tp>::value)> + : public __not_<__or_, is_reference<_Tp>, + is_void<_Tp>>>::type { }; - /// is_member_pointer - template + template struct is_member_pointer; /// is_scalar template struct is_scalar - : public integral_constant::value - || is_enum<_Tp>::value - || is_pointer<_Tp>::value - || is_member_pointer<_Tp>::value - || __is_nullptr_t<_Tp>::value)> + : public __or_, is_enum<_Tp>, is_pointer<_Tp>, + is_member_pointer<_Tp>, __is_nullptr_t<_Tp>>::type { }; /// is_compound @@ -311,15 +423,19 @@ template struct __is_member_pointer_helper : public false_type { }; - _DEFINE_SPEC(2, __is_member_pointer_helper, _Tp _Cp::*, true) + template + struct __is_member_pointer_helper<_Tp _Cp::*> + : public true_type { }; + template - struct is_member_pointer + struct is_member_pointer : public integral_constant::type>::value)> { }; // type properties. + /// is_const template struct is_const @@ -338,6 +454,33 @@ struct is_volatile<_Tp volatile> : public true_type { }; + /// is_trivial + template + struct is_trivial + : public integral_constant + { }; + + /// is_trivially_copyable (still unimplemented) + + /// is_standard_layout + template + struct is_standard_layout + : public integral_constant + { }; + + /// is_pod + // Could use is_standard_layout && is_trivial instead of the builtin. + template + struct is_pod + : public integral_constant + { }; + + /// is_literal_type + template + struct is_literal_type + : public integral_constant + { }; + /// is_empty template struct is_empty @@ -356,336 +499,362 @@ : public integral_constant { }; - /// has_virtual_destructor + template::value, + bool = is_floating_point<_Tp>::value> + struct __is_signed_helper + : public false_type { }; + template - struct has_virtual_destructor - : public integral_constant - { }; + struct __is_signed_helper<_Tp, false, true> + : public true_type { }; - /// alignment_of template - struct alignment_of - : public integral_constant { }; - - /// rank - template - struct rank - : public integral_constant { }; - - template - struct rank<_Tp[_Size]> - : public integral_constant::value> { }; + struct __is_signed_helper<_Tp, true, false> + : public integral_constant(_Tp(-1) < _Tp(0))> + { }; + /// is_signed template - struct rank<_Tp[]> - : public integral_constant::value> { }; - - /// extent - template - struct extent - : public integral_constant { }; - - template - struct extent<_Tp[_Size], _Uint> - : public integral_constant::value> + struct is_signed + : public integral_constant::value> { }; - template - struct extent<_Tp[], _Uint> - : public integral_constant::value> + /// is_unsigned + template + struct is_unsigned + : public __and_, __not_>>::type { }; - // relationships between types [4.6]. - /// is_same - template - struct is_same - : public false_type { }; + // destructible and constructible type properties + template + struct add_rvalue_reference; + template - struct is_same<_Tp, _Tp> - : public true_type { }; + typename add_rvalue_reference<_Tp>::type declval() noexcept; - // const-volatile modifications [4.7.1]. + template + struct extent; - /// remove_const + template + struct remove_all_extents; + template - struct remove_const - { typedef _Tp type; }; + struct __is_array_known_bounds + : public integral_constant::value > 0)> + { }; template - struct remove_const<_Tp const> - { typedef _Tp type; }; - - /// remove_volatile - template - struct remove_volatile - { typedef _Tp type; }; + struct __is_array_unknown_bounds + : public __and_, __not_>>::type + { }; + struct __do_is_destructible_impl_1 + { + template + struct __w { _Up __u; }; + + template&>().~__w<_Tp>())> + static true_type __test(int); + + template + static false_type __test(...); + }; + template - struct remove_volatile<_Tp volatile> - { typedef _Tp type; }; - - /// remove_cv - template - struct remove_cv + struct __is_destructible_impl_1 + : public __do_is_destructible_impl_1 { - typedef typename - remove_const::type>::type type; + typedef decltype(__test<_Tp>(0)) type; }; - - /// add_const + + struct __do_is_destructible_impl_2 + { + template().~_Tp())> + static true_type __test(int); + + template + static false_type __test(...); + }; + template - struct add_const - { typedef _Tp const type; }; - - /// add_volatile - template - struct add_volatile - { typedef _Tp volatile type; }; - - /// add_cv - template - struct add_cv + struct __is_destructible_impl_2 + : public __do_is_destructible_impl_2 { - typedef typename - add_const::type>::type type; + typedef decltype(__test<_Tp>(0)) type; }; - // array modifications. + template, + __is_array_unknown_bounds<_Tp>>::value, + bool = __or_, is_function<_Tp>>::value> + struct __is_destructible_safe; - /// remove_extent template - struct remove_extent - { typedef _Tp type; }; + struct __is_destructible_safe<_Tp, false, false> + : public conditional::value, + __is_destructible_impl_2<_Tp>, + __is_destructible_impl_1<_Tp>>::type::type + { }; - template - struct remove_extent<_Tp[_Size]> - { typedef _Tp type; }; + template + struct __is_destructible_safe<_Tp, true, false> + : public false_type { }; template - struct remove_extent<_Tp[]> - { typedef _Tp type; }; + struct __is_destructible_safe<_Tp, false, true> + : public true_type { }; - /// remove_all_extents + /// is_destructible template - struct remove_all_extents - { typedef _Tp type; }; + struct is_destructible + : public integral_constant::value)> + { }; - template - struct remove_all_extents<_Tp[_Size]> - { typedef typename remove_all_extents<_Tp>::type type; }; + struct __do_is_default_constructible_impl + { + template + static true_type __test(int); + template + static false_type __test(...); + }; + template - struct remove_all_extents<_Tp[]> - { typedef typename remove_all_extents<_Tp>::type type; }; + struct __is_default_constructible_impl + : public __do_is_default_constructible_impl + { + typedef decltype(__test<_Tp>(0)) type; + }; - // pointer modifications. + template + struct __is_default_constructible_atom + : public __and_, + __is_default_constructible_impl<_Tp>>::type::type + { }; - template - struct __remove_pointer_helper - { typedef _Tp type; }; + template::value> + struct __is_default_constructible_safe; - template - struct __remove_pointer_helper<_Tp, _Up*> - { typedef _Up type; }; + // The following technique is a workaround for a gcc defect, which does + // not sfinae away attempts to default-construct arrays of unknown bounds. + // Complete arrays can be default-constructed, if the element type is + // default-constructible, but arrays with unknown bounds are not: - /// remove_pointer template - struct remove_pointer - : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type> + struct __is_default_constructible_safe<_Tp, true> + : public __and_<__is_array_known_bounds<_Tp>, + __is_default_constructible_atom::type>>::type::type { }; - template - struct remove_reference; - - /// add_pointer template - struct add_pointer - { typedef typename remove_reference<_Tp>::type* type; }; + struct __is_default_constructible_safe<_Tp, false> + : public __is_default_constructible_atom<_Tp>::type + { }; - // Primary classification traits. - - /// is_lvalue_reference - template - struct is_lvalue_reference - : public false_type { }; - + /// is_default_constructible template - struct is_lvalue_reference<_Tp&> - : public true_type { }; + struct is_default_constructible + : public integral_constant::value)> + { }; - /// is_rvalue_reference - template - struct is_rvalue_reference - : public false_type { }; + struct __do_is_static_castable_impl + { + template(declval<_From>()))> + static true_type __test(int); - template - struct is_rvalue_reference<_Tp&&> - : public true_type { }; + template + static false_type __test(...); + }; - // Secondary classification traits. + template + struct __is_static_castable_impl + : public __do_is_static_castable_impl + { + typedef decltype(__test<_From, _To>(0)) type; + }; - /// is_reference - template - struct is_reference - : public integral_constant::value - || is_rvalue_reference<_Tp>::value)> + template + struct __is_static_castable_safe + : public __and_<__or_, is_destructible<_To>>, + __is_static_castable_impl<_From, _To>>::type::type { }; - // Reference transformations. + // __is_static_castable + template + struct __is_static_castable + : public integral_constant::value)> + { }; - /// remove_reference - template - struct remove_reference - { typedef _Tp type; }; + struct __do_is_direct_constructible_impl + { + template()))> + static true_type __test(int); - template - struct remove_reference<_Tp&> - { typedef _Tp type; }; + template + static false_type __test(...); + }; - template - struct remove_reference<_Tp&&> - { typedef _Tp type; }; + template + struct __is_direct_constructible_impl + : public __do_is_direct_constructible_impl + { + typedef decltype(__test<_Tp, _Arg>(0)) type; + }; - template::value && !is_void<_Tp>::value, - bool = is_rvalue_reference<_Tp>::value> - struct __add_lvalue_reference_helper - { typedef _Tp type; }; + template + struct __is_direct_constructible_new_safe + : public __and_, + __is_direct_constructible_impl<_Tp, _Arg>>::type::type + { }; - template - struct __add_lvalue_reference_helper<_Tp, true, false> - { typedef _Tp& type; }; + template + struct is_same; - template - struct __add_lvalue_reference_helper<_Tp, false, true> - { typedef typename remove_reference<_Tp>::type& type; }; + template + struct is_base_of; - /// add_lvalue_reference - template - struct add_lvalue_reference - : public __add_lvalue_reference_helper<_Tp> - { }; + template + struct remove_reference; - template::value && !is_void<_Tp>::value> - struct __add_rvalue_reference_helper - { typedef _Tp type; }; + template::value> + struct __is_base_to_derived_ref; - template - struct __add_rvalue_reference_helper<_Tp, true> - { typedef _Tp&& type; }; + template + struct __is_base_to_derived_ref<_From, _To, true> + { + typedef typename remove_cv::type>::type __src_t; + typedef typename remove_cv::type>::type __dst_t; + typedef typename __and_< + __not_>, + is_base_of<__src_t, __dst_t> + >::type type; + static constexpr bool value = type::value; + }; - /// add_rvalue_reference - template - struct add_rvalue_reference - : public __add_rvalue_reference_helper<_Tp> + template + struct __is_base_to_derived_ref<_From, _To, false> + : public false_type { }; - // Scalar properties and transformations. + template, + is_rvalue_reference<_To>>::value> + struct __is_lvalue_to_rvalue_ref; - template::value, - bool = is_floating_point<_Tp>::value> - struct __is_signed_helper - : public false_type { }; + template + struct __is_lvalue_to_rvalue_ref<_From, _To, true> + { + typedef typename remove_cv::type>::type __src_t; + typedef typename remove_cv::type>::type __dst_t; + typedef typename __or_< + is_same<__src_t, __dst_t>, + is_base_of<__dst_t, __src_t> + >::type type; + static constexpr bool value = type::value; + }; - template - struct __is_signed_helper<_Tp, false, true> - : public true_type { }; - - template - struct __is_signed_helper<_Tp, true, false> - : public integral_constant(_Tp(-1) < _Tp(0))> + template + struct __is_lvalue_to_rvalue_ref<_From, _To, false> + : public false_type { }; - /// is_signed - template - struct is_signed - : public integral_constant::value> - { }; + // Here we handle direct-initialization to a reference type + // as equivalent to a static_cast modulo overshooting conversions. + // These are restricted to the following conversion: + // a) A base class to a derived class reference + // b) An lvalue-reference to an rvalue-reference - /// is_unsigned - template - struct is_unsigned - : public integral_constant::value - && !is_signed<_Tp>::value)> + template + struct __is_direct_constructible_ref_cast + : public __and_<__is_static_castable<_Arg, _Tp>, + __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>, + __is_lvalue_to_rvalue_ref<_Arg, _Tp> + >>>::type::type { }; - // Member introspection. + // Direct-initialization is tricky, because of functional + // casts: For a conversion to reference we fall back to a + // static_cast modulo extra cases, otherwise we use a + // new expression: - /// is_trivial - template - struct is_trivial - : public integral_constant + template + struct __is_direct_constructible_new + : public conditional::value, + __is_direct_constructible_ref_cast<_Tp, _Arg>, + __is_direct_constructible_new_safe<_Tp, _Arg> + >::type { }; - /// is_standard_layout - template - struct is_standard_layout - : public integral_constant + template + struct __is_direct_constructible + : public integral_constant::type::value)> { }; - /// is_pod - // Could use is_standard_layout && is_trivial instead of the builtin. - template - struct is_pod - : public integral_constant - { }; + struct __do_is_nary_constructible_impl + { + template()...))> + static true_type __test(int); - /// is_literal_type - template - struct is_literal_type - : public integral_constant - { }; + template + static false_type __test(...); + }; - template - typename add_rvalue_reference<_Tp>::type declval() noexcept; + template + struct __is_nary_constructible_impl + : public __do_is_nary_constructible_impl + { + typedef decltype(__test<_Tp, _Args...>(0)) type; + }; template - class __is_constructible_helper - : public __sfinae_types + struct __is_nary_constructible + : public __and_, + __is_nary_constructible_impl<_Tp, _Args...> + >::type::type { - template - static decltype(_Tp1(declval<_Args1>()...), __one()) __test(int); + static_assert(sizeof...(_Args) > 1, + "Only useful for > 1 arguments"); + }; - template - static __two __test(...); + template + struct __is_constructible_impl + : public __is_nary_constructible<_Tp, _Args...> + { }; - public: - static const bool __value = sizeof(__test<_Tp, _Args...>(0)) == 1; - }; - template - class __is_constructible_helper<_Tp, _Arg> - : public __sfinae_types - { - template - static decltype(static_cast<_Tp1>(declval<_Arg1>()), __one()) - __test(int); + struct __is_constructible_impl<_Tp, _Arg> + : public __is_direct_constructible<_Tp, _Arg> + { }; - template - static __two __test(...); + template + struct __is_constructible_impl<_Tp> + : public is_default_constructible<_Tp> + { }; - public: - static const bool __value = sizeof(__test<_Tp, _Arg>(0)) == 1; - }; - /// is_constructible - // XXX FIXME - // The C++0x specifications require front-end support, see N2255. template struct is_constructible - : public integral_constant::__value> + : public integral_constant::value)> { }; + template struct __is_nt_constructible_helper { static const bool __value = false; }; @@ -750,8 +919,64 @@ : public integral_constant { }; - // Relationships between types. + /// has_virtual_destructor + template + struct has_virtual_destructor + : public integral_constant + { }; + + // type property queries. + + /// alignment_of + template + struct alignment_of + : public integral_constant { }; + + /// rank + template + struct rank + : public integral_constant { }; + + template + struct rank<_Tp[_Size]> + : public integral_constant::value> { }; + + template + struct rank<_Tp[]> + : public integral_constant::value> { }; + + /// extent + template + struct extent + : public integral_constant { }; + + template + struct extent<_Tp[_Size], _Uint> + : public integral_constant::value> + { }; + + template + struct extent<_Tp[], _Uint> + : public integral_constant::value> + { }; + + + // type relations. + + /// is_same + template + struct is_same + : public false_type { }; + + template + struct is_same<_Tp, _Tp> + : public true_type { }; + /// is_base_of template struct is_base_of @@ -759,8 +984,8 @@ { }; template::value || is_function<_To>::value - || is_array<_To>::value)> + bool = __or_, is_function<_To>, + is_array<_To>>::value> struct __is_convertible_helper { static const bool __value = is_void<_To>::value; }; @@ -783,8 +1008,6 @@ }; /// is_convertible - // XXX FIXME - // The C++0x specifications require front-end support, see N2255. template struct is_convertible : public integral_constant { }; - template - struct __aligned_storage_msa - { - union __type - { - unsigned char __data[_Len]; - struct __attribute__((__aligned__)) { } __align; - }; - }; - /** - * @brief Alignment type. - * - * The value of _Align is a default-alignment which shall be the - * most stringent alignment requirement for any C++ object type - * whose size is no greater than _Len (3.9). The member typedef - * type shall be a POD type suitable for use as uninitialized - * storage for any object whose size is at most _Len and whose - * alignment is a divisor of _Align. - */ - template::__type)> - struct aligned_storage - { - union type - { - unsigned char __data[_Len]; - struct __attribute__((__aligned__((_Align)))) { } __align; - }; - }; + // const-volatile modifications. + /// remove_const + template + struct remove_const + { typedef _Tp type; }; - // Define a nested type if some predicate holds. - // Primary template. - /// enable_if - template - struct enable_if - { }; + template + struct remove_const<_Tp const> + { typedef _Tp type; }; + + /// remove_volatile + template + struct remove_volatile + { typedef _Tp type; }; - // Partial specialization for true. template - struct enable_if - { typedef _Tp type; }; + struct remove_volatile<_Tp volatile> + { typedef _Tp type; }; + + /// remove_cv + template + struct remove_cv + { + typedef typename + remove_const::type>::type type; + }; + + /// add_const + template + struct add_const + { typedef _Tp const type; }; + + /// add_volatile + template + struct add_volatile + { typedef _Tp volatile type; }; + + /// add_cv + template + struct add_cv + { + typedef typename + add_const::type>::type type; + }; - // A conditional expression, but for types. If true, first, if false, second. - // Primary template. - /// conditional - template - struct conditional - { typedef _Iftrue type; }; + // Reference transformations. - // Partial specialization for false. - template - struct conditional - { typedef _Iffalse type; }; + /// remove_reference + template + struct remove_reference + { typedef _Tp type; }; + template + struct remove_reference<_Tp&> + { typedef _Tp type; }; - // Decay trait for arrays and functions, used for perfect forwarding - // in make_pair, make_tuple, etc. - template::value, - bool _IsFunction = is_function<_Up>::value> - struct __decay_selector; + template + struct remove_reference<_Tp&&> + { typedef _Tp type; }; - // NB: DR 705. - template - struct __decay_selector<_Up, false, false> - { typedef typename remove_cv<_Up>::type __type; }; + template>, + __not_>>::value, + bool = is_rvalue_reference<_Tp>::value> + struct __add_lvalue_reference_helper + { typedef _Tp type; }; - template - struct __decay_selector<_Up, true, false> - { typedef typename remove_extent<_Up>::type* __type; }; - - template - struct __decay_selector<_Up, false, true> - { typedef typename add_pointer<_Up>::type __type; }; - - /// decay - template - class decay - { - typedef typename remove_reference<_Tp>::type __remove_type; - - public: - typedef typename __decay_selector<__remove_type>::__type type; - }; - template - class reference_wrapper; + struct __add_lvalue_reference_helper<_Tp, true, false> + { typedef _Tp& type; }; - // Helper which adds a reference to a type when given a reference_wrapper template - struct __strip_reference_wrapper - { - typedef _Tp __type; - }; + struct __add_lvalue_reference_helper<_Tp, false, true> + { typedef typename remove_reference<_Tp>::type& type; }; + /// add_lvalue_reference template - struct __strip_reference_wrapper > - { - typedef _Tp& __type; - }; + struct add_lvalue_reference + : public __add_lvalue_reference_helper<_Tp> + { }; + template>, + __not_>>::value> + struct __add_rvalue_reference_helper + { typedef _Tp type; }; + template - struct __strip_reference_wrapper > - { - typedef _Tp& __type; - }; + struct __add_rvalue_reference_helper<_Tp, true> + { typedef _Tp&& type; }; + /// add_rvalue_reference template - struct __decay_and_strip - { - typedef typename __strip_reference_wrapper< - typename decay<_Tp>::type>::__type __type; - }; + struct add_rvalue_reference + : public __add_rvalue_reference_helper<_Tp> + { }; + // sign modifications. + // Utility for constructing identically cv-qualified types. template struct __cv_selector; @@ -946,7 +1154,6 @@ typedef typename __match::__type __type; }; - // Utility for finding the unsigned versions of signed integral types. template struct __make_unsigned @@ -976,7 +1183,6 @@ struct __make_unsigned { typedef unsigned long long __type; }; - // Select between integral and enum: not possible to be both. template::value, @@ -1053,7 +1259,6 @@ struct __make_signed { typedef signed long long __type; }; - // Select between integral and enum: not possible to be both. template::value, @@ -1100,6 +1305,176 @@ template<> struct make_signed; + + // array modifications. + + /// remove_extent + template + struct remove_extent + { typedef _Tp type; }; + + template + struct remove_extent<_Tp[_Size]> + { typedef _Tp type; }; + + template + struct remove_extent<_Tp[]> + { typedef _Tp type; }; + + /// remove_all_extents + template + struct remove_all_extents + { typedef _Tp type; }; + + template + struct remove_all_extents<_Tp[_Size]> + { typedef typename remove_all_extents<_Tp>::type type; }; + + template + struct remove_all_extents<_Tp[]> + { typedef typename remove_all_extents<_Tp>::type type; }; + + + // pointer modifications. + + template + struct __remove_pointer_helper + { typedef _Tp type; }; + + template + struct __remove_pointer_helper<_Tp, _Up*> + { typedef _Up type; }; + + /// remove_pointer + template + struct remove_pointer + : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type> + { }; + + /// add_pointer + template + struct add_pointer + { typedef typename remove_reference<_Tp>::type* type; }; + + + template + struct __aligned_storage_msa + { + union __type + { + unsigned char __data[_Len]; + struct __attribute__((__aligned__)) { } __align; + }; + }; + + /** + * @brief Alignment type. + * + * The value of _Align is a default-alignment which shall be the + * most stringent alignment requirement for any C++ object type + * whose size is no greater than _Len (3.9). The member typedef + * type shall be a POD type suitable for use as uninitialized + * storage for any object whose size is at most _Len and whose + * alignment is a divisor of _Align. + */ + template::__type)> + struct aligned_storage + { + union type + { + unsigned char __data[_Len]; + struct __attribute__((__aligned__((_Align)))) { } __align; + }; + }; + + + // Decay trait for arrays and functions, used for perfect forwarding + // in make_pair, make_tuple, etc. + template::value, + bool _IsFunction = is_function<_Up>::value> + struct __decay_selector; + + // NB: DR 705. + template + struct __decay_selector<_Up, false, false> + { typedef typename remove_cv<_Up>::type __type; }; + + template + struct __decay_selector<_Up, true, false> + { typedef typename remove_extent<_Up>::type* __type; }; + + template + struct __decay_selector<_Up, false, true> + { typedef typename add_pointer<_Up>::type __type; }; + + /// decay + template + class decay + { + typedef typename remove_reference<_Tp>::type __remove_type; + + public: + typedef typename __decay_selector<__remove_type>::__type type; + }; + + template + class reference_wrapper; + + // Helper which adds a reference to a type when given a reference_wrapper + template + struct __strip_reference_wrapper + { + typedef _Tp __type; + }; + + template + struct __strip_reference_wrapper > + { + typedef _Tp& __type; + }; + + template + struct __strip_reference_wrapper > + { + typedef _Tp& __type; + }; + + template + struct __decay_and_strip + { + typedef typename __strip_reference_wrapper< + typename decay<_Tp>::type>::__type __type; + }; + + + // Define a nested type if some predicate holds. + // Primary template. + /// enable_if + template + struct enable_if + { }; + + // Partial specialization for true. + template + struct enable_if + { typedef _Tp type; }; + + + // A conditional expression, but for types. If true, first, if false, second. + // Primary template. + /// conditional + template + struct conditional + { typedef _Iftrue type; }; + + // Partial specialization for false. + template + struct conditional + { typedef _Iffalse type; }; + + /// common_type template struct common_type; @@ -1119,6 +1494,20 @@ common_type::type, _Vp...>::type type; }; + /// underlying_type (still unimplemented) + + /// result_of + template + class result_of; + + template + struct result_of<_Functor(_ArgTypes...)> + { + typedef + decltype( std::declval<_Functor>()(std::declval<_ArgTypes>()...) ) + type; + }; + /// declval template struct __declval_protector @@ -1136,18 +1525,6 @@ return __declval_protector<_Tp>::__delegate(); } - /// result_of - template - class result_of; - - template - struct result_of<_Functor(_ArgTypes...)> - { - typedef - decltype( std::declval<_Functor>()(std::declval<_ArgTypes>()...) ) - type; - }; - /** * Use SFINAE to determine if the type _Tp has a publicly-accessible * member type _NTYPE. @@ -1177,11 +1554,6 @@ ::type>::value> \ { }; -#undef _DEFINE_SPEC_0_HELPER -#undef _DEFINE_SPEC_1_HELPER -#undef _DEFINE_SPEC_2_HELPER -#undef _DEFINE_SPEC - // @} group metaprogramming _GLIBCXX_END_NAMESPACE_VERSION } // namespace Index: testsuite/util/testsuite_tr1.h =================================================================== --- testsuite/util/testsuite_tr1.h (revision 172385) +++ testsuite/util/testsuite_tr1.h (working copy) @@ -1,7 +1,7 @@ // -*- C++ -*- // Testing utilities for the tr1 testsuite. // -// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 +// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -283,6 +283,130 @@ check_ret_type(T) { return true; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + namespace construct_destruct + { + struct Empty {}; + + struct B { int i; B(){} }; + struct D : B {}; + + enum E { ee1 }; + enum E2 { ee2 }; + enum class SE { e1 }; + enum class SE2 { e2 }; + + enum OpE : int; + enum class OpSE : bool; + + union U { int i; Empty b; }; + + struct Abstract + { + virtual ~Abstract() = 0; + }; + + struct AbstractDelDtor + { + ~AbstractDelDtor() = delete; + virtual void foo() = 0; + }; + + struct Ukn; + + template + struct ImplicitTo + { + operator To(); + }; + + template + struct DelImplicitTo + { + operator To() = delete; + }; + + template + struct ExplicitTo + { + explicit operator To(); + }; + + struct Ellipsis + { + Ellipsis(...){} + }; + + struct DelEllipsis + { + DelEllipsis(...) = delete; + }; + + struct Any + { + template + Any(T&&){} + }; + + struct nAny + { + template + nAny(T&&...){} + }; + + struct DelnAny + { + template + DelnAny(T&&...) = delete; + }; + + template + struct FromArgs + { + FromArgs(Args...); + }; + + struct DelDef + { + DelDef() = delete; + }; + + struct DelCopy + { + DelCopy(const DelCopy&) = delete; + }; + + struct DelDtor + { + DelDtor() = default; + DelDtor(const DelDtor&) = default; + DelDtor(DelDtor&&) = default; + DelDtor(int); + DelDtor(int, B, U); + ~DelDtor() = delete; + }; + + struct Nontrivial + { + Nontrivial(); + Nontrivial(const Nontrivial&); + Nontrivial& operator=(const Nontrivial&); + ~Nontrivial(); + }; + + union NontrivialUnion + { + int i; + Nontrivial n; + }; + + struct UnusualCopy + { + UnusualCopy(UnusualCopy&); + }; + } +#endif + } // namespace __gnu_test #endif // _GLIBCXX_TESTSUITE_TR1_H Index: testsuite/20_util/make_signed/requirements/typedefs_neg.cc =================================================================== --- testsuite/20_util/make_signed/requirements/typedefs_neg.cc (revision 172385) +++ testsuite/20_util/make_signed/requirements/typedefs_neg.cc (working copy) @@ -3,7 +3,7 @@ // 2007-05-03 Benjamin Kosnik // -// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011 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 @@ -48,5 +48,5 @@ // { dg-error "instantiated from here" "" { target *-*-* } 40 } // { dg-error "instantiated from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1097 } -// { dg-error "declaration of" "" { target *-*-* } 1061 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1302 } +// { dg-error "declaration of" "" { target *-*-* } 1266 } Index: testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc =================================================================== --- testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc (revision 172385) +++ testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc (working copy) @@ -48,5 +48,5 @@ // { dg-error "instantiated from here" "" { target *-*-* } 40 } // { dg-error "instantiated from here" "" { target *-*-* } 42 } -// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1020 } -// { dg-error "declaration of" "" { target *-*-* } 984 } +// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1226 } +// { dg-error "declaration of" "" { target *-*-* } 1190 } Index: testsuite/20_util/declval/requirements/1_neg.cc =================================================================== --- testsuite/20_util/declval/requirements/1_neg.cc (revision 172385) +++ testsuite/20_util/declval/requirements/1_neg.cc (working copy) @@ -19,7 +19,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-error "static assertion failed" "" { target *-*-* } 1134 } +// { dg-error "static assertion failed" "" { target *-*-* } 1523 } #include Index: testsuite/20_util/ratio/cons/cons_overflow_neg.cc =================================================================== --- testsuite/20_util/ratio/cons/cons_overflow_neg.cc (revision 172385) +++ testsuite/20_util/ratio/cons/cons_overflow_neg.cc (working copy) @@ -51,4 +51,4 @@ // { dg-error "instantiated from here" "" { target *-*-* } 46 } // { dg-error "denominator cannot be zero" "" { target *-*-* } 155 } // { dg-error "out of range" "" { target *-*-* } 156 } -// { dg-error "overflow in constant expression" "" { target *-*-* } 74 } +// { dg-error "overflow in constant expression" "" { target *-*-* } 99 } Index: testsuite/20_util/is_default_constructible/value.cc =================================================================== --- testsuite/20_util/is_default_constructible/value.cc (revision 0) +++ testsuite/20_util/is_default_constructible/value.cc (revision 0) @@ -0,0 +1,134 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +#include + +using namespace __gnu_test::construct_destruct; + +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, + "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, + "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible>::value, "Error"); +static_assert(std::is_default_constructible const>::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible[1]>::value, "Error"); +static_assert(std::is_default_constructible[1]>::value, + "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, + "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible::value, "Error"); +static_assert(std::is_default_constructible>::value, + "Error"); +static_assert(std::is_default_constructible>::value, "Error"); +static_assert(std::is_default_constructible< + std::initializer_list[1]>::value, "Error"); +static_assert(std::is_default_constructible[1]>::value, "Error"); + +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible>::value, "Error"); +static_assert(!std::is_default_constructible>::value, + "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, + "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, + "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible[1]>::value, "Error"); +static_assert(!std::is_default_constructible[1]>::value, + "Error"); +static_assert(!std::is_default_constructible< + FromArgs>>::value, "Error"); +static_assert(!std::is_default_constructible>>::value, "Error"); +static_assert(!std::is_default_constructible>>::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); +static_assert(!std::is_default_constructible::value, "Error"); Index: testsuite/20_util/is_default_constructible/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_default_constructible/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_default_constructible/requirements/typedefs.cc (revision 0) @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_default_constructible 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; +} Index: testsuite/20_util/is_default_constructible/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_default_constructible/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_default_constructible/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_default_constructible; +} Index: testsuite/20_util/is_function/value.cc =================================================================== --- testsuite/20_util/is_function/value.cc (revision 0) +++ testsuite/20_util/is_function/value.cc (revision 0) @@ -0,0 +1,52 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_function; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + // 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; +} Index: testsuite/20_util/is_function/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_function/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_function/requirements/typedefs.cc (revision 0) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +void test01() +{ + // Check for required typedefs + typedef std::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; +} Index: testsuite/20_util/is_function/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_function/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_function/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_function; +} Index: testsuite/20_util/is_function/24808.cc =================================================================== --- testsuite/20_util/is_function/24808.cc (revision 0) +++ testsuite/20_util/is_function/24808.cc (revision 0) @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 +#include + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_function; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/20_util/is_function/35637.cc =================================================================== --- testsuite/20_util/is_function/35637.cc (revision 0) +++ testsuite/20_util/is_function/35637.cc (revision 0) @@ -0,0 +1,32 @@ +// { dg-options "-std=gnu++0x -pedantic-errors" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +struct S +{ + void F() const {} +}; + +// libstdc++/35637 +void test01() +{ + std::function a(&S::F); +} Index: testsuite/20_util/is_destructible/value.cc =================================================================== --- testsuite/20_util/is_destructible/value.cc (revision 0) +++ testsuite/20_util/is_destructible/value.cc (revision 0) @@ -0,0 +1,100 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +#include + +using namespace __gnu_test::construct_destruct; + +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible>::value, + "Error"); +static_assert(std::is_destructible>::value, + "Error"); +static_assert(std::is_destructible::value, "Error"); +static_assert(std::is_destructible::value, "Error"); + +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); +static_assert(!std::is_destructible::value, "Error"); + +// Deleted members in unions with non-trivial members: +static_assert(!std::is_destructible::value, "Error"); + +// Unusual copy: +static_assert(std::is_destructible::value, "Error"); Index: testsuite/20_util/is_destructible/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_destructible/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_destructible/requirements/typedefs.cc (revision 0) @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::is_destructible 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; +} Index: testsuite/20_util/is_destructible/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_destructible/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_destructible/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_destructible; +} Index: testsuite/20_util/is_object/value.cc =================================================================== --- testsuite/20_util/is_object/value.cc (revision 0) +++ testsuite/20_util/is_object/value.cc (revision 0) @@ -0,0 +1,47 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 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 +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_object; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + + // Sanity check. + VERIFY( (test_category(true)) ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/20_util/is_object/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_object/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_object/requirements/typedefs.cc (revision 0) @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +// { dg-do compile } + +void test01() +{ + // Check for required typedefs + typedef std::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; +} Index: testsuite/20_util/is_object/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_object/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_object/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_object; +} Index: testsuite/20_util/is_object/24808.cc =================================================================== --- testsuite/20_util/is_object/24808.cc (revision 0) +++ testsuite/20_util/is_object/24808.cc (revision 0) @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 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 +#include + +// libstdc++/24808 +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_object; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); +} + +int main() +{ + test01(); + return 0; +} Index: testsuite/20_util/is_convertible/value.cc =================================================================== --- testsuite/20_util/is_convertible/value.cc (revision 172385) +++ testsuite/20_util/is_convertible/value.cc (working copy) @@ -2,7 +2,7 @@ // 2009-10-29 Paolo Carlini // -// Copyright (C) 2009 Free Software Foundation, Inc. +// Copyright (C) 2009, 2011 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 @@ -58,6 +58,8 @@ VERIFY( (test_relationship(true)) ); VERIFY( (test_relationship(true)) ); + VERIFY( (test_relationship(true)) ); + // Negative tests. VERIFY( (test_relationship(false)) ); VERIFY( (test_relationship(false)) ); @@ -93,8 +95,6 @@ const volatile int&>(false)) ); VERIFY( (test_relationship(false)) ); - VERIFY( (test_relationship(true)) ); - VERIFY( (test_relationship(false)) ); VERIFY( (test_relationship(false)) ); } Index: testsuite/20_util/is_compound/value.cc =================================================================== --- testsuite/20_util/is_compound/value.cc (revision 0) +++ testsuite/20_util/is_compound/value.cc (revision 0) @@ -0,0 +1,57 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 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 +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_compound; + using namespace __gnu_test; + + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); + VERIFY( (test_category(false)) ); +#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; +} Index: testsuite/20_util/is_compound/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_compound/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_compound/requirements/typedefs.cc (revision 0) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +void test01() +{ + // Check for required typedefs + typedef std::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; +} Index: testsuite/20_util/is_compound/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_compound/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_compound/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_compound; +} Index: testsuite/20_util/is_member_object_pointer/value.cc =================================================================== --- testsuite/20_util/is_member_object_pointer/value.cc (revision 0) +++ testsuite/20_util/is_member_object_pointer/value.cc (revision 0) @@ -0,0 +1,58 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 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 +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_member_object_pointer; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + // 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; +} Index: testsuite/20_util/is_member_object_pointer/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_member_object_pointer/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_member_object_pointer/requirements/typedefs.cc (revision 0) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +void test01() +{ + // Check for required typedefs + typedef std::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; +} Index: testsuite/20_util/is_member_object_pointer/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_member_object_pointer/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_member_object_pointer/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_member_object_pointer; +} Index: testsuite/20_util/is_fundamental/value.cc =================================================================== --- testsuite/20_util/is_fundamental/value.cc (revision 0) +++ testsuite/20_util/is_fundamental/value.cc (revision 0) @@ -0,0 +1,57 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2011 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 +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_fundamental; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); +#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; +} Index: testsuite/20_util/is_fundamental/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_fundamental/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_fundamental/requirements/typedefs.cc (revision 0) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +void test01() +{ + // Check for required typedefs + typedef std::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; +} Index: testsuite/20_util/is_fundamental/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_fundamental/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_fundamental/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_fundamental; +} Index: testsuite/20_util/is_member_pointer/value.cc =================================================================== --- testsuite/20_util/is_member_pointer/value.cc (revision 0) +++ testsuite/20_util/is_member_pointer/value.cc (revision 0) @@ -0,0 +1,53 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 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 +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_member_pointer; + using namespace __gnu_test; + + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + 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; +} Index: testsuite/20_util/is_member_pointer/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_member_pointer/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_member_pointer/requirements/typedefs.cc (revision 0) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +void test01() +{ + // Check for required typedefs + typedef std::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; +} Index: testsuite/20_util/is_member_pointer/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_member_pointer/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_member_pointer/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_member_pointer; +} Index: testsuite/20_util/is_member_function_pointer/value.cc =================================================================== --- testsuite/20_util/is_member_function_pointer/value.cc (revision 0) +++ testsuite/20_util/is_member_function_pointer/value.cc (revision 0) @@ -0,0 +1,58 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2011 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 +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using std::is_member_function_pointer; + using namespace __gnu_test; + + // Positive tests. + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + VERIFY( (test_category(true)) ); + + // 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; +} Index: testsuite/20_util/is_member_function_pointer/requirements/typedefs.cc =================================================================== --- testsuite/20_util/is_member_function_pointer/requirements/typedefs.cc (revision 0) +++ testsuite/20_util/is_member_function_pointer/requirements/typedefs.cc (revision 0) @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 + +void test01() +{ + // Check for required typedefs + typedef std::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; +} Index: testsuite/20_util/is_member_function_pointer/requirements/explicit_instantiation.cc =================================================================== --- testsuite/20_util/is_member_function_pointer/requirements/explicit_instantiation.cc (revision 0) +++ testsuite/20_util/is_member_function_pointer/requirements/explicit_instantiation.cc (revision 0) @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +{ + typedef short test_type; + template struct is_member_function_pointer; +} Index: testsuite/20_util/is_constructible/value-2.cc =================================================================== --- testsuite/20_util/is_constructible/value-2.cc (revision 0) +++ testsuite/20_util/is_constructible/value-2.cc (revision 0) @@ -0,0 +1,819 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +#include + +using namespace __gnu_test::construct_destruct; + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible, + std::initializer_list>::value, "Error"); +static_assert(std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible>::value, "Error"); +static_assert(!std::is_constructible>::value, "Error"); +static_assert(!std::is_constructible>::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible>::value, "Error"); +static_assert(std::is_constructible&>::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible&>::value, "Error"); +static_assert(std::is_constructible>::value, "Error"); +static_assert(std::is_constructible&>::value, "Error"); +static_assert(std::is_constructible>::value, "Error"); + +static_assert(std::is_constructible>::value, "Error"); +static_assert(std::is_constructible&>::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error" ); +static_assert(!std::is_constructible::value, "Error" ); +static_assert(!std::is_constructible::value, "Error" ); + +static_assert(!std::is_constructible::value, "Error" ); +static_assert(!std::is_constructible::value, "Error" ); +static_assert(!std::is_constructible::value, "Error" ); +static_assert(!std::is_constructible::value, "Error" ); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, + "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible, int, int>::value, "Error"); +static_assert(!std::is_constructible, int, int>::value, + "Error"); +static_assert(!std::is_constructible, void, int>::value, "Error"); +static_assert(!std::is_constructible, void, int>::value, + "Error"); +static_assert(!std::is_constructible, void, void>::value, "Error"); +static_assert(!std::is_constructible, void, void>::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible&, int, int>::value, "Error"); +static_assert(!std::is_constructible&, void, int>::value, "Error"); +static_assert(!std::is_constructible&, void, void>::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible, int, int>::value, "Error"); +static_assert(!std::is_constructible, int, int>::value, + "Error"); +static_assert(!std::is_constructible, void, int>::value, "Error"); +static_assert(!std::is_constructible, void, int>::value, + "Error"); +static_assert(!std::is_constructible, void, int>::value, + "Error"); +static_assert(!std::is_constructible, void, + int>::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); + +// Deleted members in unions with non-trivial members: +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +// Unusual copy: +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); + +static_assert(std::is_constructible, + int, char>::value, "Error"); +static_assert(std::is_constructible, + int, char>::value, "Error"); +static_assert(std::is_constructible, + int, int>::value, "Error"); +static_assert(std::is_constructible, + int, int>::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible, + ImplicitTo, ImplicitTo>::value, "Error"); +static_assert(std::is_constructible, + ImplicitTo, ImplicitTo>::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible::value, "Error"); +static_assert(std::is_constructible, + std::initializer_list>, std::initializer_list, + std::initializer_list>::value, "Error"); +static_assert(std::is_constructible, + std::initializer_list>, std::initializer_list, + std::initializer_list>::value, "Error"); +static_assert(std::is_constructible, + std::initializer_list>, std::initializer_list&, + std::initializer_list&>::value, "Error"); +static_assert(!std::is_constructible&, + std::initializer_list&>, std::initializer_list, + std::initializer_list>::value, "Error"); + +static_assert(!std::is_constructible>, + int, int>::value, "Error"); +static_assert(!std::is_constructible>, int, int>::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, + "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(!std::is_constructible::value, "Error"); +static_assert(!std::is_constructible::value, "Error"); + +static_assert(std::is_constructible>::value, "Error"); +static_assert(std::is_constructible>::value, + "Error"); +static_assert(std::is_constructible>::value, "Error"); +static_assert(std::is_constructible>::value, + "Error"); + +static_assert(!std::is_constructible>::value, + "Error"); +static_assert(!std::is_constructible>::value, "Error"); + +// Binding through reference-compatible type is required to perform +// direct-initialization as described in [over.match.ref] p. 1 b. 1: +static_assert(std::is_constructible>::value, "Error"); +static_assert(std::is_constructible>::value, + "Error"); +static_assert(std::is_constructible>::value, "Error"); + +// Binding through temporary behaves like copy-initialization, +// see [dcl.init.ref] p. 5, very last sub-bullet: +static_assert(!std::is_constructible>::value, + "Error"); +static_assert(!std::is_constructible>::value, + "Error");