stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r678931 - in /stdcxx/branches/4.3.x: include/ include/rw/ tests/include/ tests/utilities/
Date Tue, 22 Jul 2008 22:19:29 GMT
Author: vitek
Date: Tue Jul 22 15:19:28 2008
New Revision: 678931

URL: http://svn.apache.org/viewvc?rev=678931&view=rev
Log:
2008-07-22  Travis Vitek  <vitek@roguewave.com>

	* include/type_traits [_RWSTD_NO_ALIGN_TRAITS]: Conditionally remove
	traits that deal with alignment as there is a good chance they will
	be removed from the draft.
	* include/rw/_defs.h: Define _RWSTD_NO_ALIGN_TRAITS if one or more of
	the alignment helper macros is not provided.
	* include/rw/_meta_prop.h: Stop defining _TT_ macros in workarounds.
	Add fallback for alignment_of<>. Temporarily remove msvc-8.0 workarounds.
	* include/rw/_meta_other.h: Simplify implementation of aligned_storage
	and aligned_union traits.
	* include/rw/_config-acc.h: Update comment after guard macro.
	* include/rw/_config-gcc.h: Remove _RWSTD_EXT_CXX_0X macro.
	* include/rw/_config-eccp.h: Disable a few built-in traits.
	* include/rw/_config.h: Remove _RWSTD_EXT_CXX_0X macro.
	* tests/include/rw/rw_testdefs.h: Enable strict conformance testing for
	next version of EDG C++ and G++.
	* tests/utilities/20.meta.trans.other.cpp (test_aligned_storage):
	Disable testing aligned_storage<> and aligned_union<> if compiler
	support is unavailable or disabled.
	* tests/utilities/20.meta.unary.nothrow.cpp (run_test): Move test body
	to new function.
	(test_has_nothrow_copy): Add new function. Conditionally disable tests
	for types that require rvalue-references or variadic template support.
	Conditionally disable test when compiler support is unavailable.
	* tests/utilities/20.meta.unary.cat.cpp (test_trait): Fix assert to
	display correct line number. Update warning message.
	(test_is_union): Conditionally disable test when compiler support is
	unavailable.
	* tests/utilities/20.meta.unary.prop.cpp: Conditionally disable parts
	of tests that require compiler support. Add assertsions to several of
	the test_has_trivial_* and test_has_nothrow_* tests. Expect traits
	has_trivial_assign, has_trivial_copy, has_nothrow_assign and
	has_nothrow_copy to fail for array types.
	(test_alignment_of): Add tests for alignment_of. 
	* tests/utilities/20.meta.unary.rel.cpp: Append a `t' to a few
	internal test class names.
	(test_is_base_of): Disable portion of test if required support
	is not available.


Modified:
    stdcxx/branches/4.3.x/include/rw/_config-acc.h
    stdcxx/branches/4.3.x/include/rw/_config-eccp.h
    stdcxx/branches/4.3.x/include/rw/_config-gcc.h
    stdcxx/branches/4.3.x/include/rw/_config.h
    stdcxx/branches/4.3.x/include/rw/_defs.h
    stdcxx/branches/4.3.x/include/rw/_meta_cat.h
    stdcxx/branches/4.3.x/include/rw/_meta_other.h
    stdcxx/branches/4.3.x/include/rw/_meta_prop.h
    stdcxx/branches/4.3.x/include/rw/_meta_rel.h
    stdcxx/branches/4.3.x/include/type_traits
    stdcxx/branches/4.3.x/tests/include/rw_testdefs.h
    stdcxx/branches/4.3.x/tests/utilities/20.meta.rel.cpp
    stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.other.cpp
    stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp
    stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp
    stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp

Modified: stdcxx/branches/4.3.x/include/rw/_config-acc.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_config-acc.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_config-acc.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_config-acc.h Tue Jul 22 15:19:28 2008
@@ -110,6 +110,6 @@
 #  define _RWSTD_TT_MAX_ALIGNMENT  128
 #  define _RWSTD_TT_ALIGNED_POD(N) \
       struct { unsigned char _C_align __attribute__ ((aligned ((N)))); }
-#endif // 
+#endif // __HP_aCC >= 6.00
 
 

Modified: stdcxx/branches/4.3.x/include/rw/_config-eccp.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_config-eccp.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_config-eccp.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_config-eccp.h Tue Jul 22 15:19:28 2008
@@ -72,11 +72,17 @@
 #  define _RWSTD_TT_IS_UNION(T)             __is_union(T)
 #  define _RWSTD_TT_IS_CLASS(T)             __is_class(T)
 #  define _RWSTD_TT_IS_POD(T)               __is_pod(T)
-#  define _RWSTD_TT_IS_EMPTY(T)             __is_empty(T)
+
+// __is_empty() fails to detect union types
+//#  define _RWSTD_TT_IS_EMPTY(T)             __is_empty(T)
 #  define _RWSTD_TT_IS_POLYMORPHIC(T)       __is_polymorphic(T)
-#  define _RWSTD_TT_IS_CONVERTIBLE(T,U)     __is_convertible_to(T,U)
+
+// __is_convertible_to() fails for decay and void-void conversions
+//#  define _RWSTD_TT_IS_CONVERTIBLE(T,U)     __is_convertible_to(T,U)
 #  define _RWSTD_TT_IS_ABSTRACT(T)          __is_abstract(T)
-#  define _RWSTD_TT_IS_BASE_OF(T,U)         __is_base_of(T,U)
+
+// __is_base_of() gives false positives for union types
+//#  define _RWSTD_TT_IS_BASE_OF(T,U)         __is_base_of(T,U)
 
 #  define _RWSTD_TT_HAS_TRIVIAL_CTOR(T)     __has_trivial_constructor(T)
 #  define _RWSTD_TT_HAS_TRIVIAL_COPY(T)     __has_trivial_copy(T)
@@ -93,6 +99,6 @@
 #  define _RWSTD_TT_MAX_ALIGNMENT           16
 
 // need to find a way to align data
-#  define _RWSTD_TT_ALIGNED_POD(N)          struct { double _C_align; }
+//#  define _RWSTD_TT_ALIGNED_POD(N)          struct { double _C_align; }
 #endif   // __EDG_VERSION__ >= 3.10 
 

Modified: stdcxx/branches/4.3.x/include/rw/_config-gcc.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_config-gcc.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_config-gcc.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_config-gcc.h Tue Jul 22 15:19:28 2008
@@ -208,11 +208,6 @@
      // C++ 0x features supported since 4.3.0
 #    undef _RWSTD_NO_VARIADIC_TEMPLATES
 #    undef _RWSTD_NO_RVALUE_REFERENCES
-
-#    ifndef _RWSTD_EXT_CXX_0X
-       // enable our C++ 0x extensions in GNU gcc C++ 0x mode
-#      define _RWSTD_EXT_CXX_0X
-#    endif
 #  endif
 
 #endif   // __GNUC__ >= 4.3

Modified: stdcxx/branches/4.3.x/include/rw/_config.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_config.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_config.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_config.h Tue Jul 22 15:19:28 2008
@@ -495,9 +495,4 @@
 #  undef _RWSTD_NO_TEMPLATE_DEFINITIONS
 #endif
 
-#ifndef _RWSTD_EXT_CXX_0X
-   // disable C++0x extensions unless asked to enable them
-#  define _RWSTD_NO_EXT_CXX_0X
-#endif
-
 #endif   // _RWSTD_RW_CONFIG_H_INCLUDED

Modified: stdcxx/branches/4.3.x/include/rw/_defs.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_defs.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_defs.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_defs.h Tue Jul 22 15:19:28 2008
@@ -1584,4 +1584,15 @@
           memcpy (va_dst, va_src, sizeof (va_list))
 #endif   // _RWSTD_NO_VA_LIST_ARRAY
 
+
+// disable aligned type traits if compiler support is not
+// configured
+#if    !defined (_RWSTD_TT_ALIGN_OF)    \
+    || !defined (_RWSTD_TT_ALIGNED_POD) \
+    || !defined (_RWSTD_TT_MAX_ALIGNMENT)
+#  ifndef _RWSTD_NO_ALIGN_TRAITS
+#    define _RWSTD_NO_ALIGN_TRAITS
+#  endif
+#endif
+
 #endif   // _RWSTD_RW_DEFS_H_INCLUDED

Modified: stdcxx/branches/4.3.x/include/rw/_meta_cat.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_meta_cat.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_meta_cat.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_meta_cat.h Tue Jul 22 15:19:28 2008
@@ -206,41 +206,42 @@
     };
 };
 
-// if one of _RWSTD_TT_IS_CLASS or _RWSTD_TT_IS_UNION is defined, then
-// this will all work out. if neither is defined, then we say all class
-// types (including unios) are classes and none of them are unions.
-#if !defined (_RWSTD_TT_IS_CLASS) && !defined (_RWSTD_TT_IS_UNION)
-#  define _RWSTD_TT_IS_CLASS(T) _RW::__rw_is_class_or_union<T>::value
-#  define _RWSTD_TT_IS_UNION(T) 0
-#elif !defined (_RWSTD_TT_IS_CLASS)
-#  define _RWSTD_TT_IS_CLASS(T) \
-      _RW::__rw_is_class_or_union<T>::value && !_RWSTD_TT_IS_UNION(T)
-#elif !defined (_RWSTD_TT_IS_UNION)
-#  define _RWSTD_TT_IS_UNION(T)  \
+#if defined (_RWSTD_TT_IS_UNION)
+#  define _RWSTD_IS_UNION(T) _RWSTD_TT_IS_UNION(T)
+#elif defined (_RWSTD_TT_IS_CLASS)
+#  define _RWSTD_IS_UNION(T)  \
       _RW::__rw_is_class_or_union<T>::value && !_RWSTD_TT_IS_CLASS(T)
+#else
+#  define _RWSTD_IS_UNION(T) 0
 #endif
 
 template <class _TypeT>
 struct __rw_is_union
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_UNION(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_UNION(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_UNION(T) _RW::__rw_is_union<T>::value
 
+#if defined (_RWSTD_TT_IS_CLASS)
+#  define _RWSTD_IS_CLASS(T) _RWSTD_TT_IS_CLASS(T)
+#elif defined (_RWSTD_TT_IS_UNION)
+#  define _RWSTD_IS_CLASS(T) \
+      _RW::__rw_is_class_or_union<T>::value && !_RWSTD_TT_IS_UNION(T)
+#else
+#  define _RWSTD_IS_CLASS(T) _RW::__rw_is_class_or_union<T>::value
+#endif
 
 template <class _TypeT>
 struct __rw_is_class
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_CLASS(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_CLASS(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_CLASS(T) _RW::__rw_is_class<T>::value
-
-
 
 
-#ifndef _RWSTD_TT_IS_ENUM
+#ifdef _RWSTD_TT_IS_ENUM
+#  define _RWSTD_IS_ENUM(T) _RWSTD_TT_IS_ENUM(T)
+#else
 
 template <class _TypeT, bool =    __rw_is_void<_TypeT>::value
                                || __rw_is_array<_TypeT>::value
@@ -254,7 +255,6 @@
     enum { _C_value = 0 };
 };
 
-//
 template <class _TypeT>
 struct __rw_is_enum_impl<_TypeT, false>
 {
@@ -272,21 +272,20 @@
     };
 };
 
-#  define _RWSTD_TT_IS_ENUM(T) _RW::__rw_is_enum_impl<T>::_C_value
-#endif // _RWSTD_TT_IS_ENUM
+#  define _RWSTD_IS_ENUM(T) _RW::__rw_is_enum_impl<T>::_C_value
+#endif // !_RWSTD_TT_IS_ENUM
 
 template <class _TypeT>
 struct __rw_is_enum
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_ENUM(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_ENUM(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_ENUM(T) _RW::__rw_is_enum<T>::value
-
 
 
-
-#ifndef _RWSTD_TT_IS_FUNCTION
+#ifdef _RWSTD_TT_IS_FUNCTION
+#  define _RWSTD_IS_FUNCTION(T) _RWSTD_TT_IS_FUNCTION(T)
+#else
 
 //
 // This template prevents the partial specialization below from
@@ -331,17 +330,15 @@
     enum { _C_value = sizeof (_C_yes) == sizeof (_C_is (_C_make ())) };
 };
 
-#  define _RWSTD_TT_IS_FUNCTION(T) _RW::__rw_is_function_impl<T>::_C_value
+#  define _RWSTD_IS_FUNCTION(T) _RW::__rw_is_function_impl<T>::_C_value
 #endif //_RWSTD_TT_IS_FUNCTION
 
 template <class _TypeT>
 struct __rw_is_function
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_FUNCTION(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_FUNCTION(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_FUNCTION(T) _RW::__rw_is_function<T>::value
-
 
 template <class _TypeT>
 struct __rw_is_member_object_pointer : __rw_false_type

Modified: stdcxx/branches/4.3.x/include/rw/_meta_other.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_meta_other.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_meta_other.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_meta_other.h Tue Jul 22 15:19:28 2008
@@ -57,6 +57,7 @@
 #define _RWSTD_CONDITIONAL(C,T,U) _RW::__rw_conditional<C,T,U>::type
 
 
+#ifndef _RWSTD_NO_ALIGN_TRAITS
 
 // Helper for __rw_default_alignment. The member value will evaluate
 // to the nearest power of two that is a valid alignment value that
@@ -102,11 +103,9 @@
     } type;
 };
 
-
 #else // !__GNUG__
 
-// Helper for __rw_aligned_storage. Specializations define a member type
-// that is aligned on power of two boundaries.
+// Helper for __rw_aligned_storage.
 template <_RWSTD_SIZE_T _Align>
 struct __rw_aligned_storage_impl;
 
@@ -181,42 +180,35 @@
 template <class _TypeT, class... _Types>
 struct __rw_biggest<_TypeT, _Types...>
 {
-    typedef typename
-    __rw_biggest<_Types...>::type _TypeU;
-
-    typedef typename
-    __rw_conditional<sizeof (_TypeT) < sizeof (_TypeU),
-                     _TypeU, _TypeT>::type type;
+    enum { _C_values = __rw_biggest<_Types...>::_C_value,
+           _C_value  =   sizeof (_TypeT) < _C_values
+                       ? _C_values 
+                       : sizeof (_TypeT) };
 };
 
 template <class _TypeT>
 struct __rw_biggest<_TypeT>
 {
-    typedef _TypeT type;
+    enum { _C_value = sizeof (_TypeT) };
 };
 
-// Helper for __rw_aligned_union. Provides a typedef type that
-// is the type with the strictest alignment requirement in the
-// sequence of provided types.
+// Helper for __rw_aligned_union.
 template <class... _Types>
 struct __rw_strictest;
 
 template <class _TypeT, class... _Types>
 struct __rw_strictest<_TypeT, _Types...>
 {
-    typedef typename
-    __rw_strictest<_Types...>::type _TypeU;
-
-    typedef typename
-    __rw_conditional<   __rw_alignment_of<_TypeT>::value
-                      < __rw_alignment_of<_TypeU>::value,
-                     _TypeU, _TypeT>::type type;
+    enum { _C_values = __rw_strictest<_Types...>::_C_value,
+           _C_value =   __rw_alignment_of<_TypeT>::value < _C_values
+                      ? _C_values
+                      : __rw_alignment_of<_TypeT>::value };
 };
 
 template <class _TypeT>
 struct __rw_strictest<_TypeT>
 {
-    typedef _TypeT type;
+    enum { _C_value = __rw_alignment_of<_TypeT>::value };
 };
 
 template <_RWSTD_SIZE_T _Len, class... _Types>
@@ -225,121 +217,72 @@
 template <_RWSTD_SIZE_T _Len, class _TypeT, class... _Types>
 struct __rw_aligned_union<_Len, _TypeT, _Types...>
 {
-    typedef typename
-    __rw_biggest<_TypeT, _Types...>::type _C_biggest;
-
-    typedef typename
-    __rw_strictest<_TypeT, _Types...>::type _C_strictest;
-
-    static const _RWSTD_SIZE_T _C_size_value =
-        sizeof (_C_biggest);
-
-    static const _RWSTD_SIZE_T alignment_value =
-        __rw_alignment_of<_C_strictest>::value;
+    enum { _C_len_value   = _Len,
+           _C_size_value  = __rw_biggest<_TypeT, _Types...>::_C_value,
+           _C_align_value = __rw_strictest<_TypeT, _Types...>::_C_value };
 
     typedef typename
-    __rw_aligned_storage<_Len < _C_size_value ? _C_size_value : _Len,
-                         alignment_value>::type type;
+    __rw_aligned_storage<  _C_len_value < _C_size_value
+                         ? _C_size_value : _C_len_value,
+                         _C_align_value>::type type;
 };
 
-#if 0
-#  ifndef _RWSTD_NO_STATIC_CONST_MEMBER_DEFINITION
-
-template <_RWSTD_SIZE_T _Len, class... _Types>
-const _RWSTD_SIZE_T
-__rw_aligned_union<_Len, _Types...>::alignment_value;
-
-template <_RWSTD_SIZE_T _Len, class... _Types>
-const _RWSTD_SIZE_T
-__rw_aligned_union<_Len, _Types...>::_C_size_value;
+#else // _RWSTD_NO_VARIADIC_TEMPLATES
 
-#  endif // _RWSTD_NO_STATIC_CONST_MEMBER_DEFINITION
-#endif // 0
+// Helper. Gives the largest of a series of values.
+template <unsigned _A    , unsigned _B = 0,
+          unsigned _C = 0, unsigned _D = 0,
+          unsigned _E = 0, unsigned _F = 0,
+          unsigned _G = 0, unsigned _H = 0>
+struct __rw_max_uint
+{
+    enum {
+            _C_ab = _A < _B ? _B : _A,
+            _C_cd = _C < _D ? _D : _C,
+            _C_abcd = _C_ab < _C_cd ? _C_cd : _C_ab,
+
+            _C_ef = _E < _F ? _F : _E,
+            _C_gh = _G < _H ? _H : _G,
+            _C_efgh = _C_ef < _C_gh ? _C_gh : _C_ef,
 
-#else // _RWSTD_NO_VARIADIC_TEMPLATES
+            _C_value = _C_abcd < _C_efgh ?  _C_efgh : _C_abcd
+    };
+};
 
 struct __rw_empty { };
 
-// Helper for __rw_aligned_union. Provides a typedef type that
-// is the largest type in the sequence of provided types.
+// Helper for __rw_aligned_union.
 template <class _Type1             , class _Type2 = __rw_empty,
           class _Type3 = __rw_empty, class _Type4 = __rw_empty,
           class _Type5 = __rw_empty, class _Type6 = __rw_empty,
           class _Type7 = __rw_empty, class _Type8 = __rw_empty>
 struct __rw_biggest
 {
-    typedef typename
-    __rw_conditional<(sizeof (_Type1) < sizeof (_Type2)),
-                     _Type2, _Type1>::type _Type12;
-
-    typedef typename
-    __rw_conditional<(sizeof (_Type3) < sizeof (_Type4)),
-                     _Type4, _Type3>::type _Type34;
-
-    typedef typename
-    __rw_conditional<(sizeof (_Type5) < sizeof (_Type6)),
-                     _Type6, _Type5>::type _Type56;
-
-    typedef typename
-    __rw_conditional<(sizeof (_Type7) < sizeof (_Type8)),
-                     _Type8, _Type7>::type _Type78;
-
-    typedef typename
-    __rw_conditional<(sizeof (_Type12) < sizeof (_Type34)),
-                     _Type34, _Type12>::type _Type1234;
-
-    typedef typename
-    __rw_conditional<(sizeof (_Type56) < sizeof (_Type78)),
-                     _Type78, _Type56>::type _Type5678;
-
-    typedef typename
-    __rw_conditional<(sizeof (_Type1234) < sizeof (_Type5678)),
-                     _Type5678, _Type1234>::type type;
+    enum { _C_value =
+        __rw_max_uint<sizeof (_Type1), sizeof (_Type2),
+                      sizeof (_Type3), sizeof (_Type4),
+                      sizeof (_Type5), sizeof (_Type6),
+                      sizeof (_Type7), sizeof (_Type8)>::_C_value
+    };
 };
 
-// Helper for __rw_aligned_union. Provides a typedef type that
-// is the type with the strictest alignment requirement in the
-// sequence of provided types.
+// Helper for __rw_aligned_union.
 template <class _Type1             , class _Type2 = __rw_empty,
           class _Type3 = __rw_empty, class _Type4 = __rw_empty,
           class _Type5 = __rw_empty, class _Type6 = __rw_empty,
           class _Type7 = __rw_empty, class _Type8 = __rw_empty>
 struct __rw_strictest
 {
-    typedef typename
-    __rw_conditional<   (__rw_alignment_of<_Type1>::value)
-                      < (__rw_alignment_of<_Type2>::value),
-                     _Type2, _Type1>::type _Type12;
-
-    typedef typename
-    __rw_conditional<   (__rw_alignment_of<_Type3>::value)
-                      < (__rw_alignment_of<_Type4>::value),
-                     _Type4, _Type3>::type _Type34;
-
-    typedef typename
-    __rw_conditional<   (__rw_alignment_of<_Type5>::value)
-                      < (__rw_alignment_of<_Type6>::value),
-                     _Type6, _Type5>::type _Type56;
-
-    typedef typename
-    __rw_conditional<   (__rw_alignment_of<_Type7>::value)
-                      < (__rw_alignment_of<_Type8>::value),
-                     _Type8, _Type7>::type _Type78;
-
-    typedef typename
-    __rw_conditional<   (__rw_alignment_of<_Type12>::value)
-                      < (__rw_alignment_of<_Type34>::value),
-                     _Type34, _Type12>::type _Type1234;
-
-    typedef typename
-    __rw_conditional<   (__rw_alignment_of<_Type56>::value)
-                      < (__rw_alignment_of<_Type78>::value),
-                     _Type78, _Type56>::type _Type5678;
-
-    typedef typename
-    __rw_conditional<   (__rw_alignment_of<_Type1234>::value)
-                      < (__rw_alignment_of<_Type5678>::value),
-                     _Type5678, _Type1234>::type type;
+    enum { _C_value =
+        __rw_max_uint<__rw_alignment_of<_Type1>::value,
+                      __rw_alignment_of<_Type2>::value,
+                      __rw_alignment_of<_Type3>::value,
+                      __rw_alignment_of<_Type4>::value,
+                      __rw_alignment_of<_Type5>::value,
+                      __rw_alignment_of<_Type6>::value,
+                      __rw_alignment_of<_Type7>::value,
+                      __rw_alignment_of<_Type8>::value>::_C_value
+        };
 };
 
 template <_RWSTD_SIZE_T _Len,
@@ -349,47 +292,24 @@
           class _Type7 = __rw_empty, class _Type8 = __rw_empty>
 struct __rw_aligned_union
 {
-    typedef typename
-    __rw_biggest<_Type1, _Type2, _Type3, _Type4,
-                      _Type5, _Type6, _Type7, _Type8>::type _C_biggest;
+    enum { _C_len_value   = _Len,
+           _C_size_value  =
+               __rw_biggest<_Type1, _Type2, _Type3, _Type4,
+                            _Type5, _Type6, _Type7, _Type8>::_C_value,
+           _C_align_value =
+               __rw_strictest<_Type1, _Type2, _Type3, _Type4,
+                              _Type5, _Type6, _Type7, _Type8>::_C_value
+    };
 
     typedef typename
-    __rw_strictest<_Type1, _Type2, _Type3, _Type4,
-                         _Type5, _Type6, _Type7, _Type8>::type _C_strictest;
-
-    static const _RWSTD_SIZE_T _C_size_value =
-        sizeof (_C_biggest);
-
-    static const _RWSTD_SIZE_T alignment_value =
-        __rw_alignment_of<_C_strictest>::value;
-
-    typedef typename
-    __rw_aligned_storage<_C_size_value < _Len ? _Len : _C_size_value,
-                         alignment_value>::type type;
+    __rw_aligned_storage<  _C_size_value < _C_len_value
+                         ? _C_len_value : _C_size_value,
+                         _C_align_value>::type type;
 };
 
-#ifndef _RWSTD_NO_STATIC_CONST_MEMBER_DEFINITION
-
-template <_RWSTD_SIZE_T _Len,
-          class _Type1, class _Type2, class _Type3, class _Type4,
-          class _Type5, class _Type6, class _Type7, class _Type8>
-const _RWSTD_SIZE_T
-__rw_aligned_union<_Len,
-                   _Type1, _Type2, _Type3, _Type4,
-                   _Type5, _Type6, _Type7, _Type8>::alignment_value;
-
-template <_RWSTD_SIZE_T _Len,
-          class _Type1, class _Type2, class _Type3, class _Type4,
-          class _Type5, class _Type6, class _Type7, class _Type8>
-const _RWSTD_SIZE_T
-__rw_aligned_union<_Len,
-                   _Type1, _Type2, _Type3, _Type4,
-                   _Type5, _Type6, _Type7, _Type8>::_C_size_value;
-
-#endif // _RWSTD_NO_STATIC_CONST_MEMBER_DEFINITION
-
 #endif // !_RWSTD_NO_VARIADIC_TEMPLATES
 
+#endif // !_RWSTD_NO_ALIGN_TRAITS
 
 
 template <bool _Enable, class _TypeT = void>

Modified: stdcxx/branches/4.3.x/include/rw/_meta_prop.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_meta_prop.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_meta_prop.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_meta_prop.h Tue Jul 22 15:19:28 2008
@@ -138,8 +138,9 @@
     enum { _C_value = __rw_is_scalar<_NoCV_TypeU>::value };
 };
 
-#    define _RWSTD_TT_IS_POD(T) _RW::__rw_is_pod_impl<T>::_C_value
-#elif defined (_MSC_VER) || defined (__EDG_VERSION__)
+#  define _RWSTD_IS_POD(T) _RW::__rw_is_pod_impl<T>::_C_value
+
+#elif defined (__EDG_VERSION__)
 
 template <class _TypeT>
 struct __rw_is_pod_impl
@@ -147,40 +148,41 @@
     typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
     typedef typename __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
 
-    // the MSVC provided __is_pod works for pod class types only
+    // __is_pod works for pod class types only, add scalars
     enum { _C_value =    __rw_is_scalar<_NoCV_TypeU>::value
                       || _RWSTD_TT_IS_POD(_NoCV_TypeU) };
 };
 
-#  undef  _RWSTD_TT_IS_POD
-#  define _RWSTD_TT_IS_POD(T) _RW::__rw_is_pod_impl<T>::_C_value
-#endif // !_RWSTD_TT_IS_POD || _MSC_VER
+#  define _RWSTD_IS_POD(T) _RW::__rw_is_pod_impl<T>::_C_value
+
+#else
+#  define _RWSTD_IS_POD(T) _RWSTD_TT_IS_POD(T)
+#endif // _RWSTD_TT_IS_POD
 
 template <class _TypeT>
 struct __rw_is_pod
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_POD(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_POD(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_POD(T) _RW::__rw_is_pod<T>::value
 
-
-#ifndef _RWSTD_TT_IS_STANDARD_LAYOUT
-#  define _RWSTD_TT_IS_STANDARD_LAYOUT(T) _RWSTD_IS_POD(T)
+#if !defined (_RWSTD_TT_IS_STANDARD_LAYOUT)
+#  define _RWSTD_IS_STANDARD_LAYOUT(T) _RWSTD_IS_POD(T)
+#else
+#  define _RWSTD_IS_STANDARD_LAYOUT(T) _RWSTD_TT_IS_STANDARD_LAYOUT(T)
 #endif // _RWSTD_TT_IS_STANDARD_LAYOUT
 
 template <class _TypeT>
 struct __rw_is_standard_layout
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_STANDARD_LAYOUT(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_STANDARD_LAYOUT(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_STANDARD_LAYOUT(T) _RW::__rw_is_standard_layout<T>::value
-
-
 
 
-#ifndef _RWSTD_TT_IS_EMPTY
+#if defined (_RWSTD_TT_IS_EMPTY)
+#  define _RWSTD_IS_EMPTY(T) _RWSTD_TT_IS_EMPTY(T)
+#elif defined (_RWSTD_TT_IS_CLASS) || defined (_RWSTD_TT_IS_UNION)
 
 //
 // The primary template is for the case that _TypeT is a class type.
@@ -207,33 +209,24 @@
     enum { _C_value = 0 };
 };
 
-#  define _RWSTD_TT_IS_EMPTY(T) _RW::__rw_is_empty_impl<T>::_C_value
-#elif defined (_MSC_VER) || defined (__EDG_VERSION__)
+#  define _RWSTD_IS_EMPTY(T) _RW::__rw_is_empty_impl<T>::_C_value
 
-template <class _TypeT>
-struct __rw_is_empty_impl
-{
-    enum { _C_value =    __rw_is_class<_TypeT>::value
-                      && _RWSTD_TT_IS_EMPTY (_TypeT) };
-};
-
-
-#  undef _RWSTD_TT_IS_EMPTY
-#  define _RWSTD_TT_IS_EMPTY(T) _RW::__rw_is_empty_impl<T>::_C_value
-#endif // !_RWSTD_TT_IS_EMPTY || _MSC_VER || __EDG_VERSION__
+#else
+   // we have no reliable way to reliably tell if the type is empty,
+   // so we assume that it is not.
+#  define _RWSTD_IS_EMPTY(T) 0
+#endif // !_RWSTD_TT_IS_EMPTY
 
 template <class _TypeT>
 struct __rw_is_empty
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_EMPTY(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_EMPTY(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_EMPTY(T) _RW::__rw_is_empty<T>::value
 
-
-
-
-#ifndef _RWSTD_TT_IS_POLYMORPHIC
+#if defined (_RWSTD_TT_IS_POLYMORPHIC)
+#  define _RWSTD_IS_POLYMORPHIC(T) _RWSTD_TT_IS_POLYMORPHIC(T)
+#elif defined (_RWSTD_TT_IS_CLASS) || defined (_RWSTD_TT_IS_UNION)
 
 //
 // The primary template is for the case that _TypeT is class type.
@@ -270,22 +263,24 @@
     enum { _C_value = 0 };
 };
 
-#  define _RWSTD_TT_IS_POLYMORPHIC(T) \
+#  define _RWSTD_IS_POLYMORPHIC(T) \
        _RW::__rw_is_polymorphic_impl<T>::_C_value
+
+#else
+#  define _RWSTD_IS_POLYMORPHIC(T) _RW::__rw_is_class_or_union<T>::value
 #endif // _RWSTD_TT_IS_POLYMORPHIC
 
 template <class _TypeT>
 struct __rw_is_polymorphic
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_POLYMORPHIC(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_POLYMORPHIC(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_POLYMORPHIC(T) _RW::__rw_is_polymorphic<T>::value
-
-
 
 
-#ifndef _RWSTD_TT_IS_ABSTRACT
+#if defined (_RWSTD_TT_IS_ABSTRACT)
+#  define _RWSTD_IS_ABSTRACT(T) _RWSTD_TT_IS_ABSTRACT(T)
+#elif defined (_RWSTD_TT_IS_CLASS) || defined (_RWSTD_TT_IS_UNION)
 
 //
 // The primary template is for the case that _TypeT is class type.
@@ -317,156 +312,131 @@
     enum { _C_value = 0 };
 };
 
-#  define _RWSTD_TT_IS_ABSTRACT(T) _RW::__rw_is_abstract_impl<T>::_C_value
-#endif // _RWSTD_TT_IS_ABSTRACT
+#  define _RWSTD_IS_ABSTRACT(T) _RW::__rw_is_abstract_impl<T>::_C_value
+
+#else
+#  define _RWSTD_IS_ABSTRACT(T) _RW::__rw_is_class_or_union<T>::value
+#endif // !_RWSTD_TT_IS_ABSTRACT
 
 template <class _TypeT>
 struct __rw_is_abstract
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_ABSTRACT(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_IS_ABSTRACT(_TypeT)>
 {
 };
 
-#define _RWSTD_IS_ABSTRACT(T) _RW::__rw_is_abstract<T>::value
-
-
 
 
-#ifndef _RWSTD_TT_HAS_TRIVIAL_CTOR
-   // this is just a best guess
-#  define _RWSTD_TT_HAS_TRIVIAL_CTOR(T) _RW::__rw_is_pod<T>::value
+#if !defined (_RWSTD_TT_HAS_TRIVIAL_CTOR)
+#  define _RWSTD_HAS_TRIVIAL_CTOR(T) _RW::__rw_is_pod<T>::value
 #elif defined (__EDG_VERSION__)
 
 template <class _TypeT>
 struct __rw_has_trivial_ctor_impl
 {
     typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
-    typedef typename __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
 
-    enum { _C_value =    __rw_is_scalar<_NoCV_TypeU>::value
-                      || _RWSTD_TT_HAS_TRIVIAL_CTOR (_NoCV_TypeU) };
+    enum { _C_value =    __rw_is_scalar<_TypeU>::value
+                      || _RWSTD_TT_HAS_TRIVIAL_CTOR (_TypeU) };
 };
 
-#  undef _RWSTD_TT_HAS_TRIVIAL_CTOR
-#  define _RWSTD_TT_HAS_TRIVIAL_CTOR(T) \
+#  define _RWSTD_HAS_TRIVIAL_CTOR(T) \
      _RW::__rw_has_trivial_ctor_impl<T>::_C_value
-#endif // !_RWSTD_TT_HAS_TRIVIAL_CTOR || __EDG_VERSION
+
+#else
+#  define _RWSTD_HAS_TRIVIAL_CTOR(T) _RWSTD_TT_HAS_TRIVIAL_CTOR(T)
+#endif // _RWSTD_TT_HAS_TRIVIAL_CTOR
 
 template <class _TypeT>
 struct __rw_has_trivial_ctor
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_TRIVIAL_CTOR(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_CTOR(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_TRIVIAL_CTOR(T) _RW::__rw_has_trivial_ctor<T>::value
-
 
 
-
-#ifndef _RWSTD_TT_HAS_TRIVIAL_COPY
-#  define _RWSTD_TT_HAS_TRIVIAL_COPY(T) \
-    _RW::__rw_is_pod<T>::value || _RW::__rw_is_reference<T>::value
+#if !defined (_RWSTD_TT_HAS_TRIVIAL_COPY)
+#  define _RWSTD_HAS_TRIVIAL_COPY(T)         \
+    (  !_RW::__rw_is_array<T>::value         \
+     && (   _RW::__rw_is_reference<T>::value \
+         || _RW::__rw_is_pod<T>::value))
 #elif defined (__EDG_VERSION__)
-
-template <class _TypeT>
-struct __rw_has_trivial_copy_impl
-{
-    typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
-    typedef typename __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
-
-    enum { _C_value =    __rw_is_reference<_NoCV_TypeU>::value
-                      || __rw_is_scalar<_NoCV_TypeU>::value
-                      || _RWSTD_TT_HAS_TRIVIAL_COPY (_NoCV_TypeU) };
-}; 
-#  undef _RWSTD_TT_HAS_TRIVIAL_COPY
-#  define _RWSTD_TT_HAS_TRIVIAL_COPY(T) \
-     _RW::__rw_has_trivial_copy_impl<T>::_C_value
-#endif // !_RWSTD_TT_HAS_TRIVIAL_COPY || __EDG_VERSION__
+#  define _RWSTD_HAS_TRIVIAL_COPY(T)      \
+     (   _RW::__rw_is_reference<T>::value \
+      || _RW::__rw_is_scalar<T>::value    \
+      || _RWSTD_TT_HAS_TRIVIAL_COPY(T))
+#elif defined (__GNUG__)
+#  define _RWSTD_HAS_TRIVIAL_COPY(T) \
+    (!_RW::__rw_is_array<T>::value && _RWSTD_TT_HAS_TRIVIAL_COPY(T)) 
+#else
+#  define _RWSTD_HAS_TRIVIAL_COPY(T) _RWSTD_TT_HAS_TRIVIAL_COPY(T)
+#endif // !_RWSTD_TT_HAS_TRIVIAL_COPY
 
 template <class _TypeT>
 struct __rw_has_trivial_copy
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_TRIVIAL_COPY(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_COPY(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_TRIVIAL_COPY(T) _RW::__rw_has_trivial_copy<T>::value
-
-
 
-#ifndef _RWSTD_TT_HAS_TRIVIAL_ASSIGN
-#  define _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T) \
-    _RW::__rw_is_pod<T>::value && !_RW::__rw_is_const<T>::value \
-                               && !_RW::__rw_is_reference<T>::value
+#if !defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN)
+#  define _RWSTD_HAS_TRIVIAL_ASSIGN(T)    \
+    (    _RW::__rw_is_pod<T>::value       \
+     && !_RW::__rw_is_const<T>::value     \
+     && !_RW::__rw_is_reference<T>::value \
+     && !_RW::__rw_is_array<T>::value)
 #elif defined (__EDG_VERSION__)
-
-template <class _TypeT>
-struct __rw_has_trivial_assign_impl
-{
-    typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
-
-    enum { _C_value =    !__rw_is_const<_TypeU>::value
-                      && !__rw_is_reference<_TypeU>::value
-                      && (   __rw_is_scalar<_TypeU>::value
-                          || _RWSTD_TT_HAS_TRIVIAL_ASSIGN (_TypeU)) };
-};
-
-#  undef _RWSTD_TT_HAS_TRIVIAL_ASSIGN
-#  define _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T) \
-     _RW::__rw_has_trivial_assign_impl<T>::_C_value
-#endif // !_RWSTD_TT_HAS_TRIVIAL_ASSIGN || __EDG_VERSION__
+#  define _RWSTD_HAS_TRIVIAL_ASSIGN(T) \
+        (!_RW::__rw_is_array<T>::value \
+      && !_RW::__rw_is_const<T>::value \
+      && !_RW::__rw_is_reference<T>::value \
+      && (_RW::__rw_is_scalar<T>::value || _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T)))
+#elif defined (__GNUG__)
+#  define _RWSTD_HAS_TRIVIAL_ASSIGN(T) \
+    (!_RW::__rw_is_array<T>::value && _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T))
+#else
+#  define _RWSTD_HAS_TRIVIAL_ASSIGN(T) _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T)
+#endif // _RWSTD_TT_HAS_TRIVIAL_ASSIGN
 
 template <class _TypeT>
 struct __rw_has_trivial_assign
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_TRIVIAL_ASSIGN(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_ASSIGN(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_TRIVIAL_ASSIGN(T) _RW::__rw_has_trivial_assign<T>::value
-
-
-
-
-#ifndef _RWSTD_TT_HAS_TRIVIAL_DTOR
-#  define _RWSTD_TT_HAS_TRIVIAL_DTOR(T) \
-    _RW::__rw_is_pod<T>::value && _RW::__rw_is_reference<T>::value
-#elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
-
-template <class _TypeT>
-struct __rw_has_trivial_dtor_impl
-{
-    enum { _C_value =    __rw_is_reference<_TypeT>::value
-                      || _RWSTD_TT_HAS_TRIVIAL_DTOR (_TypeT) };
-};
 
-#  undef _RWSTD_TT_HAS_TRIVIAL_DTOR
-#  define _RWSTD_TT_HAS_TRIVIAL_DTOR(T) \
-    _RW::__rw_has_trivial_dtor_impl<T>::_C_value
 
+#if !defined (_RWSTD_TT_HAS_TRIVIAL_DTOR)
+#  define _RWSTD_HAS_TRIVIAL_DTOR(T) \
+    (_RW::__rw_is_pod<T>::value || _RW::__rw_is_reference<T>::value)
+#elif defined (__GNUC__)
+#  define _RWSTD_HAS_TRIVIAL_DTOR(T)         \
+    (  _RW::__rw_is_reference<_TypeT>::value \
+     || _RWSTD_TT_HAS_TRIVIAL_DTOR (_TypeT))
 #elif defined (__EDG_VERSION__)
 
 template <class _TypeT>
 struct __rw_has_trivial_dtor_impl
 {
     typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
-    typedef typename __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
 
-    enum { _C_value =    __rw_is_scalar<_NoCV_TypeU>::value
-                      || __rw_is_reference<_NoCV_TypeU>::value
-                      || _RWSTD_TT_HAS_TRIVIAL_DTOR (_NoCV_TypeU) };
+    enum { _C_value =    __rw_is_scalar<_TypeU>::value
+                      || __rw_is_reference<_TypeU>::value
+                      || _RWSTD_TT_HAS_TRIVIAL_DTOR (_TypeU) };
 };
 
-#  undef _RWSTD_TT_HAS_TRIVIAL_DTOR
-#  define _RWSTD_TT_HAS_TRIVIAL_DTOR(T) \
+#  define _RWSTD_HAS_TRIVIAL_DTOR(T) \
     _RW::__rw_has_trivial_dtor_impl<T>::_C_value
 
-#endif // !_RWSTD_TT_HAS_TRIVIAL_DTOR || __EDG_VERSION__
+#else
+#  define _RWSTD_HAS_TRIVIAL_DTOR(T) _RWSTD_TT_HAS_TRIVIAL_DTOR(T)
+#endif // !_RWSTD_TT_HAS_TRIVIAL_DTOR
 
 template <class _TypeT>
 struct __rw_has_trivial_dtor
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_TRIVIAL_DTOR(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_TRIVIAL_DTOR(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_TRIVIAL_DTOR(T) _RW::__rw_has_trivial_dtor<T>::value
 
 
 template <class _TypeT>
@@ -494,8 +464,8 @@
 
 
 
-#ifndef _RWSTD_TT_HAS_NOTHROW_CTOR
-#  define _RWSTD_TT_HAS_NOTHROW_CTOR(T) _RW::__rw_has_trivial_ctor<T>::value
+#if !defined (_RWSTD_TT_HAS_NOTHROW_CTOR)
+#  define _RWSTD_HAS_NOTHROW_CTOR(T) _RW::__rw_has_trivial_ctor<T>::value
 #elif defined (__EDG_VERSION__)
 
 template <class _TypeT>
@@ -507,93 +477,73 @@
                       || _RWSTD_TT_HAS_NOTHROW_CTOR (_TypeU) };
 };
 
-#  undef _RWSTD_TT_HAS_NOTHROW_CTOR
-#  define _RWSTD_TT_HAS_NOTHROW_CTOR(T) \
+#  define _RWSTD_HAS_NOTHROW_CTOR(T) \
      _RW::__rw_has_nothrow_ctor_impl<T>::_C_value
-#endif // !_RWSTD_TT_HAS_NOTHROW_CTOR || __EDG_VERSION__
+
+#else
+#  define _RWSTD_HAS_NOTHROW_CTOR(T) _RWSTD_TT_HAS_NOTHROW_CTOR(T)
+#endif // _RWSTD_TT_HAS_NOTHROW_CTOR
 
 template <class _TypeT>
 struct __rw_has_nothrow_ctor
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_NOTHROW_CTOR(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_NOTHROW_CTOR(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_NOTHROW_CTOR(T) _RW::__rw_has_nothrow_ctor<T>::value
-
-
 
-#ifndef _RWSTD_TT_HAS_NOTHROW_COPY
-#  define _RWSTD_TT_HAS_NOTHROW_COPY(T) _RW::__rw_has_trivial_copy<T>::value
+#if !defined (_RWSTD_TT_HAS_NOTHROW_COPY)
+#  define _RWSTD_HAS_NOTHROW_COPY(T) _RW::__rw_has_trivial_copy<T>::value
 #elif defined (__EDG_VERSION__)
-
-template <class _TypeT>
-struct __rw_has_nothrow_copy_impl
-{
-    typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
-
-    enum { _C_value =    __rw_has_trivial_copy<_TypeT>::value
-                      || _RWSTD_TT_HAS_NOTHROW_COPY (_TypeU) };
-};
-
-#  undef _RWSTD_TT_HAS_NOTHROW_COPY
-#  define _RWSTD_TT_HAS_NOTHROW_COPY(T) \
-     _RW::__rw_has_nothrow_copy_impl<T>::_C_value
-#endif // !_RWSTD_TT_HAS_NOTHROW_COPY || __EDG_VERSION__
+#  define _RWSTD_HAS_NOTHROW_COPY(T) \
+    (_RW::__rw_has_trivial_copy<T>::value || _RWSTD_TT_HAS_NOTHROW_COPY(T))
+#elif defined (__GNUG__)
+#  define _RWSTD_HAS_NOTHROW_COPY(T) \
+    (!_RW::__rw_is_array<T>::value && _RWSTD_TT_HAS_NOTHROW_COPY(T))
+#else
+#  define _RWSTD_HAS_NOTHROW_COPY(T) _RWSTD_TT_HAS_NOTHROW_COPY(T)
+#endif // !_RWSTD_TT_HAS_NOTHROW_COPY
 
 template <class _TypeT>
 struct __rw_has_nothrow_copy
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_NOTHROW_COPY(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_NOTHROW_COPY(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_NOTHROW_COPY(T) _RW::__rw_has_nothrow_copy<T>::value
-
 
 
-
-#ifndef _RWSTD_TT_HAS_NOTHROW_ASSIGN
-#  define _RWSTD_TT_HAS_NOTHROW_ASSIGN(T) _RW::__rw_has_trivial_assign<T>::value
+#if !defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN)
+#  define _RWSTD_HAS_NOTHROW_ASSIGN(T) _RW::__rw_has_trivial_assign<T>::value
 #elif defined (__EDG_VERSION__)
-
-template <class _TypeT>
-struct __rw_has_nothrow_assign_impl
-{
-    typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
-
-    enum { _C_value =    !__rw_is_const<_TypeU>::value
-                      && !__rw_is_reference<_TypeU>::value
-                      && (   __rw_has_trivial_assign<_TypeT>::value
-                          || _RWSTD_TT_HAS_NOTHROW_ASSIGN (_TypeU)) };
-};
-
-#  undef _RWSTD_TT_HAS_NOTHROW_ASSIGN
-#  define _RWSTD_TT_HAS_NOTHROW_ASSIGN(T) \
-     _RW::__rw_has_nothrow_assign_impl<T>::_C_value
-#endif // !_RWSTD_TT_HAS_NOTHROW_ASSIGN || __EDG_VERSION__
+#  define _RWSTD_HAS_NOTHROW_ASSIGN(T) \
+      (!_RW::__rw_is_const<T>::value \
+    && !_RW::__rw_is_reference<T>::value \
+    && (_RW::__rw_has_trivial_assign<T>::value || _RWSTD_TT_HAS_NOTHROW_ASSIGN(T)))
+#elif defined (__GNUG__)
+#  define _RWSTD_HAS_NOTHROW_ASSIGN(T) \
+      (!_RW::__rw_is_array<T>::value && _RWSTD_TT_HAS_NOTHROW_ASSIGN(T))
+#else
+#  define _RWSTD_HAS_NOTHROW_ASSIGN(T) _RWSTD_TT_HAS_NOTHROW_ASSIGN(T)
+#endif // !_RWSTD_TT_HAS_NOTHROW_ASSIGN
 
 template <class _TypeT>
 struct __rw_has_nothrow_assign
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_NOTHROW_ASSIGN(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_NOTHROW_ASSIGN(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_NOTHROW_ASSIGN(T) _RW::__rw_has_nothrow_assign<T>::value
 
-
-
-#ifndef _RWSTD_TT_HAS_VIRTUAL_DTOR
-#  define _RWSTD_TT_HAS_VIRTUAL_DTOR(T) _RW::__rw_is_polymorphic<T>::value
+#if !defined (_RWSTD_TT_HAS_VIRTUAL_DTOR)
+#  define _RWSTD_HAS_VIRTUAL_DTOR(T) _RW::__rw_is_polymorphic<T>::value
+#else
+#  define _RWSTD_HAS_VIRTUAL_DTOR(T) _RWSTD_TT_HAS_VIRTUAL_DTOR(T)
 #endif // _RWSTD_TT_HAS_VIRTUAL_DTOR
 
 template <class _TypeT>
 struct __rw_has_virtual_dtor
-    : __rw_integral_constant<bool, _RWSTD_TT_HAS_VIRTUAL_DTOR(_TypeT)>
+    : __rw_integral_constant<bool, _RWSTD_HAS_VIRTUAL_DTOR(_TypeT)>
 {
 };
 
-#define _RWSTD_HAS_VIRTUAL_DTOR(T) _RW::__rw_has_virtual_dtor<T>::value
-
-
 
 template <class _TypeT>
 struct __rw_is_unsigned : __rw_false_type
@@ -653,19 +603,62 @@
 
 
 
-#ifndef _RWSTD_TT_ALIGN_OF
-#  define _RWSTD_TT_ALIGN_OF(T) 0
-#endif // _RWSTD_TT_ALIGN_OF
+#ifndef _RWSTD_NO_ALIGN_TRAITS
+
+#  if defined (_RWSTD_TT_ALIGN_OF)
+#    define _RWSTD_ALIGN_OF(T) _RWSTD_TT_ALIGN_OF(T)
+#  else
 
 template <class _TypeT>
-struct __rw_alignment_of
-    : __rw_integral_constant<_RWSTD_SIZE_T, _RWSTD_TT_ALIGN_OF(_TypeT)>
+struct __rw_alignment_of_impl
 {
+    template <class _TypeU>
+    struct _C_nest
+    {
+        unsigned char _C_char;
+        _TypeU _C_type;
+    };
+
+    enum { _C_value =
+       sizeof (_C_nest<_TypeT>) - sizeof (_TypeT) < sizeof (_TypeT)
+     ? sizeof (_C_nest<_TypeT>) - sizeof (_TypeT) < sizeof (_TypeT)
+     : sizeof (_TypeT) };
 };
 
-#define _RWSTD_ALIGNMENT_OF(T) _RW::__rw_alignment_of<T>::value
+template <>
+struct __rw_alignment_of_impl<void>
+{
+    enum { _C_value = 0 };
+};
 
+template <>
+struct __rw_alignment_of_impl<const void>
+{
+    enum { _C_value = 0 };
+};
+
+template <>
+struct __rw_alignment_of_impl<volatile void>
+{
+    enum { _C_value = 0 };
+};
+
+template <>
+struct __rw_alignment_of_impl<const volatile void>
+{
+    enum { _C_value = 0 };
+};
+
+#    define _RWSTD_ALIGN_OF(T) _RW::__rw_alignment_of_impl<T>::_C_value
+#  endif // !_RWSTD_TT_ALIGN_OF
+
+template <class _TypeT>
+struct __rw_alignment_of
+    : __rw_integral_constant<_RWSTD_SIZE_T, _RWSTD_ALIGN_OF(_TypeT)>
+{
+};
 
+#endif // !_RWSTD_NO_ALIGN_TRAITS
 
 template <class _TypeT>
 struct __rw_rank

Modified: stdcxx/branches/4.3.x/include/rw/_meta_rel.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/rw/_meta_rel.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_meta_rel.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_meta_rel.h Tue Jul 22 15:19:28 2008
@@ -63,54 +63,68 @@
 #ifndef _RWSTD_TT_IS_BASE_OF
 
 //
-// This little gem was taken from a comp.lang.c++.moderated post
-// by Rani Sharoni [see http://tinyurl.com/6pdv3k]
+// Primary template  handles case that either of _Base or _Derived
+// is not a class type.
 //
 template <class _Base, class _Derived,
-          bool =   __rw_is_class<_Base>::value
-                && __rw_is_class<_Derived>::value>
+          bool =   !__rw_is_class<_Base>::value
+                || !__rw_is_class<_Derived>::value>
 struct __rw_is_base_of_impl
 {
-    typedef typename __rw_remove_cv<_Derived>::type _NoCV_Derived;
-    typedef typename __rw_remove_cv<_Base>::type _NoCV_Base;
+    enum { _C_value = 0 };
+};
 
+//
+// This specialization is for the case that _Base and
+// _Derived are class types, but not the same type.
+//
+// This little gem was taken from a comp.lang.c++.moderated post
+// by Rani Sharoni [see http://tinyurl.com/6pdv3k]
+//
+template <class _Base, class _Derived>
+struct __rw_is_base_of_impl<_Base, _Derived, false>
+{
     struct _C_no  { };
     struct _C_yes { _C_no __pad [2]; };
 
-    // the template is used so that the compiler will prefer the
-    // non-template _C_is, in case that the conversion would be
-    // ambiguous (as it is in the case where the types are unrelated).
-    template <class _TypeT>
-    static _C_yes _C_is (_NoCV_Derived&, _TypeT);
-    static _C_no _C_is  (_NoCV_Base&   , int);
-
     struct _C_nest
     {
-        operator _NoCV_Base&    () const;
-        operator _NoCV_Derived& ();
+        operator const volatile _Base&    () const;
+        operator const volatile _Derived& ();
+
+        // the template is used so that the compiler will prefer the
+        // non-template _C_is, in case that the conversion would be
+        // ambiguous (as it is in the case where the types are unrelated).
+        template <class _TypeT>
+        static _C_yes _C_is (const volatile _Derived&, _TypeT);
+        static _C_no _C_is  (const volatile _Base&   , int);
     };
 
     enum { _C_value = 
-           __rw_is_same<_NoCV_Base, _NoCV_Derived>::value
-        || sizeof (_C_yes) == sizeof (_C_is (_C_nest (), 0)) };
+        sizeof (_C_yes) == sizeof (_C_nest::_C_is (_C_nest (), 0))
+    };
 };
 
 //
+// This specialization is for the case that _Base and
+// _Derived are the same class type.
 //
-//
-template <class _Base, class _Derived>
-struct __rw_is_base_of_impl<_Base, _Derived, false>
+template <class _TypeT>
+struct __rw_is_base_of_impl<_TypeT, _TypeT, false>
 {
-    enum { _C_value = 0 };
+    enum { _C_value = 1 };
 };
 
-#  define _RWSTD_TT_IS_BASE_OF(T,U) \
+#  define _RWSTD_IS_BASE_OF(T,U) \
      _RW::__rw_is_base_of_impl<T,U>::_C_value
+
+#else
+#  define _RWSTD_IS_BASE_OF(T,U) _RWSTD_TT_IS_BASE_OF(T,U)
 #endif // _RWSTD_TT_IS_BASE_OF
 
 template <class _Base, class _Derived>
 struct __rw_is_base_of
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_BASE_OF(_Base,_Derived)>
+    : __rw_integral_constant<bool, _RWSTD_IS_BASE_OF(_Base,_Derived)>
 {
     //_RWSTD_ASSERT (    _RWSTD_IS_CLASS (_Base)
     //               &&  _RWSTD_IS_CLASS (_Derived)
@@ -118,10 +132,8 @@
     //               ||
 };
 
-#define _RWSTD_IS_BASE_OF(T,U) _RW::__rw_is_base_of<T,U>::value
-
 
-#ifndef _RWSTD_TT_IS_CONVERTIBLE
+#if !defined (_RWSTD_TT_IS_CONVERTIBLE)
 
 template <class _From, class _To>
 struct __rw_is_convertible_impl
@@ -216,7 +228,7 @@
     enum { _C_value = 1 };
 };
 
-#  define _RWSTD_TT_IS_CONVERTIBLE(T,U) \
+#  define _RWSTD_IS_CONVERTIBLE(T,U) \
      _RW::__rw_is_convertible_1<T,U>::_C_value
 
 #elif defined (_MSC_VER)
@@ -229,23 +241,22 @@
       || _RWSTD_TT_IS_CONVERTIBLE(_TypeT, _TypeU) };
 };
 
-#  undef _RWSTD_TT_IS_CONVERTIBLE
-#  define _RWSTD_TT_IS_CONVERTIBLE(T,U) \
+#  define _RWSTD_IS_CONVERTIBLE(T,U) \
      _RW::__rw_is_convertible_1<T,U>::_C_value
 
+#else
+#  define _RWSTD_IS_CONVERTIBLE(T,U) _RWSTD_TT_IS_CONVERTIBLE(T,U)
 #endif // _RWSTD_TT_IS_CONVERTIBLE
 
 template <class _TypeT, class _TypeU>
 struct __rw_is_convertible
-    : __rw_integral_constant<bool, _RWSTD_TT_IS_CONVERTIBLE(_TypeT,_TypeU)>
+    : __rw_integral_constant<bool, _RWSTD_IS_CONVERTIBLE(_TypeT,_TypeU)>
 {
     //_RWSTD_COMPILE_ASSERT (   _RWSTD_IS_COMPLETE (_TypeT)
     //                       || _RWSTD_IS_ARRAY (_TypeT)
     //                       || _RWSTD_IS_VOID (_TypeT));
 };
 
-#define _RWSTD_IS_CONVERTIBLE(T,U) _RW::__rw_is_convertible<T,U>::value
-
 } // namespace __rw
 
 

Modified: stdcxx/branches/4.3.x/include/type_traits
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/include/type_traits?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/type_traits (original)
+++ stdcxx/branches/4.3.x/include/type_traits Tue Jul 22 15:19:28 2008
@@ -296,12 +296,16 @@
 {
 };
 
+#ifndef _RWSTD_NO_ALIGN_TRAITS
+
 template <class _TypeT>
 struct alignment_of
     : integral_constant<_RWSTD_SIZE_T, _RW::__rw_alignment_of<_TypeT>::value>
 {
 };
 
+#endif // _RWSTD_NO_ALIGN_TRAITS
+
 template <class _TypeT>
 struct rank
     : integral_constant<_RWSTD_SIZE_T, _RW::__rw_rank<_TypeT>::value>
@@ -422,6 +426,8 @@
     typedef typename _RW::__rw_add_pointer<_TypeT>::type type;
 };
 
+#ifndef _RWSTD_NO_ALIGN_TRAITS
+
 template <_RWSTD_SIZE_T _Len,
           _RWSTD_SIZE_T _Align = _RW::__rw_default_alignment<_Len>::value>
 struct aligned_storage
@@ -429,15 +435,17 @@
     typedef typename _RW::__rw_aligned_storage<_Len, _Align>::type type;
 };
 
-#ifndef _RWSTD_NO_VARIADIC_TEMPLATES
+#  ifndef _RWSTD_NO_VARIADIC_TEMPLATES
 
 template <_RWSTD_SIZE_T _Len, class _TypeT, class... _Types>
 struct aligned_union
     : _RW::__rw_aligned_union<_Len, _TypeT, _Types...>
 {
+    static const _RWSTD_SIZE_T alignment_value =
+      _RW::__rw_aligned_union<_Len, _TypeT, _Types...>::_C_align_value;
 };
 
-#else
+#  else  // !_RWSTD_NO_VARIADIC_TEMPLATES
 
 template <_RWSTD_SIZE_T _Len,
           class _Type1                  , class _Type2 = _RW::__rw_empty,
@@ -449,9 +457,15 @@
                               _Type1, _Type2, _Type3, _Type4,
                               _Type5, _Type6, _Type7, _Type8>
 {
+    static const _RWSTD_SIZE_T alignment_value =
+      _RW::__rw_aligned_union<_Len, _Type1, _Type2,
+                                    _Type3, _Type4,
+                                    _Type5, _Type6,
+                                    _Type7, _Type8>::_C_align_value;
 };
 
-#endif
+#  endif // !_RWSTD_NO_VARIADIC_TEMPLATES
+#endif // !_RWSTD_NO_ALIGN_TRAITS
 
 template <class _TypeT>
 struct decay

Modified: stdcxx/branches/4.3.x/tests/include/rw_testdefs.h
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/include/rw_testdefs.h?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/include/rw_testdefs.h (original)
+++ stdcxx/branches/4.3.x/tests/include/rw_testdefs.h Tue Jul 22 15:19:28 2008
@@ -167,4 +167,9 @@
 #  pragma warning (disable: 279)
 #endif   // Intel C++ 10.0 and prior
 
+#if    ((4 < __GNUC__) || ((4 == __GNUC__) && (3 < __GNUC_MINOR__))) \
+    || (310 < __EDG_VERSION__)
+#  define _RWSTD_TT_STRICT_CXX_0X_CONFORM
+#endif
+
 #endif   // RW_TESTDEFS_H_INCLUDED

Modified: stdcxx/branches/4.3.x/tests/utilities/20.meta.rel.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.rel.cpp?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.rel.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.rel.cpp Tue Jul 22 15:19:28 2008
@@ -68,27 +68,27 @@
 };
 
 template <class T>
-struct derived_ : T
+struct derived_t : T
 {
 };
 
 template <class T>
-struct derived_private_ : private T
+struct derived_private_t : private T
 {
 };
 
 template <class T>
-struct derived_protected_ : protected T
+struct derived_protected_t : protected T
 {
 };
 
 template <class T>
-struct derived_with_conversion_ : T
+struct derived_with_conversion_t : T
 {
-    derived_with_conversion_ (const T&);
+    derived_with_conversion_t (const T&);
 };
 
-class incomplete_;
+class incomplete_t;
 
 union union_C {
     int i_; float f_;
@@ -109,8 +109,9 @@
 }
 
 #define TEST(Trait,TypeT,TypeU,Expect)                              \
-    test_trait (__LINE__, Trait<TypeT,TypeU>::value, Expect,        \
-                #Trait, #TypeT, #TypeU)
+    { const bool value = Trait< TypeT, TypeU >::value;              \
+      test_trait (__LINE__, value, Expect, #Trait, #TypeT, #TypeU); \
+    } typedef void __dummy
 
 static void test_is_same ()
 {
@@ -124,14 +125,16 @@
     
     TEST (std::is_same, enum_A, enum_A, true);
     TEST (std::is_same, enum_B, enum_B, true);
-    
+   
     TEST (std::is_same, struct_A, struct_A, true);
-    TEST (std::is_same, derived_<struct_A>,
-                         derived_<struct_A>, true);
+
+    typedef derived_t<struct_A> derived_A;
+    TEST (std::is_same, derived_A, derived_A, true);
 
     TEST (std::is_same, class_B, class_B, true);
-    TEST (std::is_same, derived_<class_B>,
-                         derived_<class_B>, true);
+
+    typedef derived_t<class_B> derived_B;
+    TEST (std::is_same, derived_B, derived_B, true);
 
     // other combinations should fail
     TEST (std::is_same, signed char, char, false);
@@ -158,13 +161,18 @@
     TEST (std::is_same, enum_A, unsigned int, false);
     TEST (std::is_same, enum_A, unsigned long, false);
 
-    TEST (std::is_same, struct_A, derived_<struct_A>, false);
-    TEST (std::is_same, class_B, derived_<class_B>, false);
+    TEST (std::is_same, struct_A, derived_t<struct_A>, false);
+    TEST (std::is_same, class_B, derived_t<class_B>, false);
 
     TEST (std::is_same, int[], int*, false);
     TEST (std::is_same, int*, int[], false);
 }
 
+#define TEST(Trait,TypeT,TypeU,Expect)                              \
+    { const bool value = Trait< TypeT, TypeU >::value;              \
+      test_trait (__LINE__, value, Expect, #Trait, #TypeT, #TypeU); \
+    } typedef void __dummy
+
 static void test_is_base_of ()
 {
     TEST (std::is_base_of, bool, bool, false);
@@ -179,24 +187,43 @@
     TEST (std::is_base_of, enum_B, enum_B, false);
     
     TEST (std::is_base_of, struct_A, struct_A, true);
-    TEST (std::is_base_of, derived_<struct_A>,
-                           derived_<struct_A>, true);
+    TEST (std::is_base_of, derived_t<struct_A>,
+                           derived_t<struct_A>, true);
 
     TEST (std::is_base_of, class_B, class_B, true);
-    TEST (std::is_base_of, derived_<class_B>,
-                           derived_<class_B>, true);
+    TEST (std::is_base_of, derived_t<class_B>,
+                           derived_t<class_B>, true);
 
+#if    defined (_RWSTD_TT_IS_BASE_OF) \
+    || defined (_RWSTD_TT_IS_CLASS)   \
+    || defined (_RWSTD_TT_IS_UNION)
+    // without one of the above, we can't reliably implement
+    // this trait for union type
     TEST (std::is_base_of, union_C, union_C, false);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_is_base_of() have been disabled due "
+             "to lack of compiler support.");
+#endif
 
     // public inheritance
-    TEST (std::is_base_of, struct_A, derived_<struct_A>, true);
-    TEST (std::is_base_of, class_B, derived_<class_B>, true);
+    TEST (std::is_base_of, struct_A, derived_t<struct_A>, true);
+    TEST (std::is_base_of, class_B, derived_t<class_B>, true);
+
+#if defined (__SUNPRO_CC) && (__SUNPRO_CC <= 0x590)
+
+    // for some reason the trick used to detect private and protected
+    // inheritance doesn't work on sunpro-5.9
+    rw_warn (0, 0, __LINE__,
+             "unable to detect private or protected base classes.");
 
+#else
     // protected inheritance
-    TEST (std::is_base_of, struct_A, derived_protected_<struct_A>, true);
+    TEST (std::is_base_of, struct_A, derived_protected_t<struct_A>, true);
 
     // private inheritance
-    TEST (std::is_base_of, struct_A, derived_private_<struct_A>, true);
+    TEST (std::is_base_of, struct_A, derived_private_t<struct_A>, true);
+#endif
 
     // other combinations should fail
     TEST (std::is_base_of, signed char, char, false);
@@ -229,19 +256,19 @@
     TEST (std::is_base_of, struct_A, class_B, false);
     TEST (std::is_base_of, class_B, struct_A, false);
 
-    TEST (std::is_base_of, derived_<struct_A>, struct_A, false);
-    TEST (std::is_base_of, derived_<class_B>, class_B, false);
+    TEST (std::is_base_of, derived_t<struct_A>, struct_A, false);
+    TEST (std::is_base_of, derived_t<class_B>, class_B, false);
 }
 
 static void test_is_convertible ()
 {
-    TEST (std::is_convertible, derived_<struct_A> , struct_A , true); // slice
-    TEST (std::is_convertible, derived_<struct_A>*, struct_A*, true);
-    TEST (std::is_convertible, derived_<struct_A>&, struct_A&, true);
-
-    TEST (std::is_convertible, derived_<class_B> , class_B , true); // slice
-    TEST (std::is_convertible, derived_<class_B>*, class_B*, true);
-    TEST (std::is_convertible, derived_<class_B>&, class_B&, true);
+    TEST (std::is_convertible, derived_t<struct_A> , struct_A , true); // slice
+    TEST (std::is_convertible, derived_t<struct_A>*, struct_A*, true);
+    TEST (std::is_convertible, derived_t<struct_A>&, struct_A&, true);
+
+    TEST (std::is_convertible, derived_t<class_B> , class_B , true); // slice
+    TEST (std::is_convertible, derived_t<class_B>*, class_B*, true);
+    TEST (std::is_convertible, derived_t<class_B>&, class_B&, true);
 
     TEST (std::is_convertible, convertible_to_A, struct_A, true);
     TEST (std::is_convertible, struct_A, convertible_to_A, false);
@@ -320,7 +347,7 @@
 
     //// from an abstract type is allowed
     //TEST (std::is_convertible, abstract_, int, false);
-    //TEST (std::is_convertible, derived_<abstract_>, abstract_, false);
+    //TEST (std::is_convertible, derived_t<abstract_>, abstract_, false);
 
     TEST (std::is_convertible, long*, void*, true);
     TEST (std::is_convertible, void*, long*, false);
@@ -343,24 +370,24 @@
     TEST (std::is_convertible, int (*)(), void*, false);
 
     TEST (std::is_convertible,
-          int (*)(derived_<struct_A>*),
+          int (*)(derived_t<struct_A>*),
           int (*)(struct_A*), false);
 
     TEST (std::is_convertible,
           int (*)(struct_A*),
-          int (*)(derived_<struct_A>*), false);
+          int (*)(derived_t<struct_A>*), false);
 
     // pointer to derived member convertible to
     // pointer to base member
     TEST (std::is_convertible,
-          int derived_<struct_A>::*,
+          int derived_t<struct_A>::*,
           int struct_A::*, false);
 
     // pointer to base member convertible to
     // pointer to derived member
     TEST (std::is_convertible,
           int struct_A::*,
-          int derived_<struct_A>::*, true);
+          int derived_t<struct_A>::*, true);
 
     TEST (std::is_convertible, int, double, true);
     TEST (std::is_convertible, const int, double, true);

Modified: stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.other.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.other.cpp?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.other.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.other.cpp Tue Jul 22 15:19:28 2008
@@ -156,6 +156,14 @@
 
 static void test_aligned_storage ()
 {
+#ifdef _RWSTD_NO_ALIGN_TRAITS
+
+    rw_warn (0, 0, __LINE__,
+             "test_aligned_storage disabled because "
+             "_RWSTD_NO_ALIGN_TRAITS is defined");
+
+#else
+
 #define TEST(Size,Align)                                           \
     {                                                              \
       typedef std::aligned_storage<Size, Align>::type storage_t;   \
@@ -205,10 +213,14 @@
     TEST (19);
 
 #undef  TEST
+
+#endif // _RWSTD_NO_ALIGN_TRAITS
 }
 
 /**************************************************************************/
 
+#ifndef _RWSTD_NO_ALIGN_TRAITS
+
 struct null_t { };
 
 // get the maximum of 8 values
@@ -301,8 +313,19 @@
 
 struct struct_t { };
 
+#endif // !_RWSTD_NO_ALIGN_TRAITS
+
+
 static void test_aligned_union ()
 {
+#ifdef _RWSTD_NO_ALIGN_TRAITS
+
+    rw_warn (0, 0, __LINE__,
+             "test_aligned_union disabled because "
+             "_RWSTD_NO_ALIGN_TRAITS is defined");
+
+#else
+
 #define TEST(Len,T1) \
     aligned_union_tester<Len,T1>::test(__LINE__,#T1)
 
@@ -344,6 +367,8 @@
     TEST (17, void (struct_t::*)(), long, int, void*, char);
 
 #undef  TEST
+
+#endif // _RWSTD_NO_ALIGN_TRAITS
 }
 
 /**************************************************************************/

Modified: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.cat.cpp Tue Jul 22 15:19:28 2008
@@ -46,7 +46,7 @@
 {
     // verify that the expected trait is actually working
 
-    if (rw_assert (value != false, 0, __LINE__,
+    if (rw_assert (value != false, 0, line,
                    "%s<%s>::value was %b, expected true",
                    trait_name, type_name, value))
     {
@@ -193,7 +193,8 @@
     TEST(std::is_rvalue_reference, char&&);
 #else
     rw_warn (0, 0, __LINE__,
-             "no compiler support for rvalue references; test disabled");
+             "test_is_rvalue_reference() disabled because "
+             "_RWSTD_NO_RVALUE_REFERENCES is defined");
 #endif   // _RWSTD_NO_RVALUE_REFERENCES
 }
 
@@ -243,7 +244,16 @@
 
 static void test_is_union ()
 {
+#if !defined (_RWSTD_TT_IS_CLASS) && !defined (_RWSTD_TT_IS_UNION)
+
+    rw_warn (0, 0, __LINE__,
+             "test_is_union() disabled because neither of "
+             "_RWSTD_TT_IS_CLASS or _RWSTD_TT_IS_UNION is "
+             "defined");
+
+#else
     TEST (std::is_union, union_t);
+#endif
 }
 
 static void test_is_class ()

Modified: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.nothrow.cpp Tue Jul 22 15:19:28 2008
@@ -593,8 +593,16 @@
 
 
 static int
-run_test (int, char*[])
+test_has_nothrow_copy ()
 {
+#ifndef _RWSTD_TT_HAS_NOTHROW_COPY
+
+    rw_warn (0, 0, __LINE__,
+             "test_has_nothrow_copy() disabled because "
+             "_RWSTD_TT_HAS_NOTHROW_COPY is not defined");
+
+#else
+
     // exercise the has_nothrow_copy_constructor trait
 #define TEST(T)                                                         \
     rw_assert (std::has_nothrow_copy_constructor<T>::value == T::value, \
@@ -607,39 +615,47 @@
     TEST (A::A3);
     TEST (A::A4);
     TEST (A::A5);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
     TEST (A::A6);
     TEST (A::A7);
     TEST (A::A8);
     TEST (A::A9);
+#endif
 
     TEST (B::B1);
     TEST (B::B2);
     TEST (B::B3);
     TEST (B::B4);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
     TEST (B::B5);
     TEST (B::B6);
     TEST (B::B7);
     TEST (B::B8);
+#endif
 
     TEST (C::C1);
     TEST (C::C2);
     TEST (C::C3);
     TEST (C::C4);
     TEST (C::C5);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
     TEST (C::C6);
     TEST (C::C7);
     TEST (C::C8);
     TEST (C::C9);
+#endif
 
     TEST (D::D1);
     TEST (D::D2);
     TEST (D::D3);
     TEST (D::D4);
     TEST (D::D5);
+#ifndef _RWSTD_NO_RVALUE_REFERENCES
     TEST (D::D6);
     TEST (D::D7);
     TEST (D::D8);
     TEST (D::D9);
+#endif
 
     TEST (E::E1);
     TEST (E::E2);
@@ -675,8 +691,12 @@
     TEST (J::J4);
 
     TEST (K::K1);
+#  ifndef _RWSTD_NO_VARIADIC_TEMPLATES
     TEST (K::K2);
+#  endif
+#  ifndef _RWSTD_NO_RVALUE_REFERENCES
     TEST (K::K3);
+#  endif
     TEST (K::K4);
     TEST (K::K5);
 
@@ -697,6 +717,16 @@
     TEST (L::L15);
     TEST (L::L16);
 
+#endif
+
+    return 0;
+}
+
+static int
+run_test (int, char*[])
+{
+    test_has_nothrow_copy ();
+
     return 0;
 }
 

Modified: stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp?rev=678931&r1=678930&r2=678931&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp (original)
+++ stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp Tue Jul 22 15:19:28 2008
@@ -236,7 +236,7 @@
 }
 
 #define _TEST(Trait, Type, Expect)                                   \
-    test_trait (__LINE__, Trait<Type>::value, Expect, #Trait, #Type)
+    test_trait (__LINE__, Trait< Type >::value, Expect, #Trait, #Type)
 
 #define TEST(Trait, Type, Expect)                                    \
     _TEST (Trait, Type, Expect)
@@ -401,9 +401,30 @@
     TEST (std::has_trivial_assign, V long&, false);
     TEST (std::has_trivial_assign, CV long&, false);
 
-    TEST (std::has_trivial_assign, long[2], true);
+    TEST (std::has_trivial_assign, long [2], false);
 
+#if    defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
+    || defined (_RWSTD_TT_IS_POD)
     TEST (std::has_trivial_assign, struct_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_assign() have been disabled "
+             "due to lack of compiler support.");
+#endif
+
+    TEST (std::has_trivial_assign, struct_t [2], false);
+    TEST (std::has_trivial_assign, const struct_t, false);
+    TEST (std::has_trivial_assign, struct_t&, false);
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN)
+    TEST (std::has_trivial_assign, no_trivial_ctor_t, true);
+    TEST (std::has_trivial_assign, no_trivial_copy_t, true);
+    TEST (std::has_trivial_assign, no_trivial_dtor_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_assign() have been disabled "
+             "due to lack of compiler support.");
+#endif
 
     TEST (std::has_trivial_assign, no_trivial_assign_t, false);
     TEST (std::has_trivial_assign, public_derived_t<no_trivial_assign_t>, false);
@@ -421,10 +442,33 @@
     TEST (std::has_nothrow_assign, V long&, false);
     TEST (std::has_nothrow_assign, CV long&, false);
 
-    TEST (std::has_nothrow_assign, long[2], true);
+    TEST (std::has_nothrow_assign, long [2], false);
 
+#if    defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN) \
+    || defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
+    || defined (_RWSTD_TT_IS_POD)
     TEST (std::has_nothrow_assign, struct_t, true);
-    TEST (std::has_nothrow_assign, no_trivial_assign_t, true);
+    TEST (std::has_nothrow_assign, volatile struct_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_nothrow_assign() have been disabled "
+             "due to lack of compiler support.");
+#endif
+
+    TEST (std::has_nothrow_assign, struct_t [2], false);
+    TEST (std::has_nothrow_assign, const struct_t, false);
+    TEST (std::has_nothrow_assign, struct_t&, false);
+
+#if defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN)
+    TEST (std::has_nothrow_assign, no_trivial_ctor_t, true);
+    TEST (std::has_nothrow_assign, no_trivial_copy_t, true);
+    TEST (std::has_nothrow_assign, no_trivial_dtor_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_nothrow_assign() have been disabled "
+             "due to lack of compiler support.");
+#endif
+
     TEST (std::has_nothrow_assign, throwing_assign_t, false);
 }
 
@@ -445,6 +489,11 @@
     TEST (std::is_trivial, V long&, false);
     TEST (std::is_trivial, CV long&, false);
 
+#if (   defined (_RWSTD_TT_HAS_TRIVIAL_CTOR)   \
+     && defined (_RWSTD_TT_HAS_TRIVIAL_COPY)   \
+     && defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
+     && defined (_RWSTD_TT_HAS_TRIVIAL_DTOR))  \
+     || defined (_RWSTD_TT_IS_POD)
     TEST (std::is_trivial, class_t, true);
     TEST (std::is_trivial, struct_t, true);
     TEST (std::is_trivial, union_t, true);
@@ -454,6 +503,11 @@
 
     TEST (std::is_trivial, non_empty_t, true);
     TEST (std::is_trivial, public_derived_t<non_empty_t>, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_is_trivial() have been disabled "
+             "due to lack of compiler support.");
+#endif
 
     TEST (std::is_trivial, abstract_t, false);
     TEST (std::is_trivial, public_derived_t<abstract_t>, false);
@@ -473,14 +527,13 @@
 #undef TEST
 #define TEST(Trait,Type,Expect)                                      \
     _TEST(Trait, Type, Expect);                                      \
-    _TEST(Trait, std::add_const<Type>::type, Expect);                \
-    _TEST(Trait, std::add_volatile<Type>::type, Expect);             \
-    _TEST(Trait, std::add_cv<Type>::type, Expect)
+    _TEST(Trait, std::add_const< Type >::type, Expect);              \
+    _TEST(Trait, std::add_volatile< Type >::type, Expect);           \
+    _TEST(Trait, std::add_cv< Type >::type, Expect)
 
 static void test_is_standard_layout ()
 {
     TEST (std::is_standard_layout, long, true);
-    TEST (std::is_standard_layout, non_empty_t, true);
 
     // no non-static data members of non-standard-layout type
     TEST (std::is_standard_layout, member_t<access_controlled_t>, false);
@@ -514,9 +567,24 @@
     typedef public_derived_with_member<empty_t,int> derived_from_empty_with_member;
     TEST (std::is_standard_layout, derived_from_empty_with_member, false);
 
+#if    defined (_RWSTD_TT_IS_STANDARD_LAYOUT)   \
+    || defined (_RWSTD_TT_IS_POD)
+    TEST (std::is_standard_layout, non_empty_t, true);
+
+#  if defined (_RWSTD_TT_STRICT_CXX_0X_CONFORM)
+
     // but we are allowed non-static members in one base class
     TEST (std::is_standard_layout, public_derived_t<non_empty_t>, true);
-    TEST (std::is_standard_layout, public_derived_t<public_derived_t<non_empty_t> >, true);
+    TEST (std::is_standard_layout,
+          public_derived_t<public_derived_t<non_empty_t> >, true);
+
+#  endif // _RWSTD_TT_STRICT_CXX_0X_CONFORM
+
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_is_standard_layout() have been disabled "
+             "due to lack of compiler support.");
+#endif
 
     // but not two base classes with non-static members
     typedef public_derived_with_member<non_empty_t, int> derived_from_non_empty_with_member;
@@ -536,13 +604,14 @@
     TEST (std::is_pod, long, true);
     TEST (std::is_pod, long [], true);
     TEST (std::is_pod, long [2], true);
-    TEST (std::is_pod, long (*)[2], true);
+    TEST (std::is_pod, long (*) [2], true);
 
     TEST (std::is_pod, void*, true);
     TEST (std::is_pod, void (*)(), true);
-    TEST (std::is_pod, void (*[])(), true);
+    TEST (std::is_pod, void (* [])(), true);
     TEST (std::is_pod, void (class_t::*)(), true);
 
+#if defined (_RWSTD_TT_IS_POD)
     // standard layout and trivial
     // 
     TEST (std::is_pod, struct_t, true);
@@ -550,10 +619,18 @@
     TEST (std::is_pod, enum_t, true);
 
     TEST (std::is_pod, empty_t, true);
-    TEST (std::is_pod, public_derived_t<empty_t>, true);
-
     TEST (std::is_pod, non_empty_t, true);
+
+#  if defined (_RWSTD_TT_STRICT_CXX_0X_CONFORM)
+    TEST (std::is_pod, public_derived_t<empty_t>, true);
     TEST (std::is_pod, public_derived_t<non_empty_t>, true);
+#  endif
+
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_is_pod() have been disabled "
+             "due to lack of compiler support.");
+#endif
 
     TEST (std::is_pod, abstract_t, false);
     TEST (std::is_pod, public_derived_t<abstract_t>, false);
@@ -580,8 +657,16 @@
 
     TEST (std::is_empty, empty_union, false);
 
+#if    defined(_RWSTD_TT_IS_EMPTY)  \
+    || defined (_RWSTD_TT_IS_CLASS) \
+    || defined (_RWSTD_TT_IS_UNION)
     TEST (std::is_empty, empty_t, true);
     TEST (std::is_empty, public_derived_t<empty_t>, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_is_empty() have been disabled "
+             "due to lack of compiler support.");
+#endif
 
     TEST (std::is_empty, non_empty_t, false);
     TEST (std::is_empty, public_derived_t<non_empty_t>, false);
@@ -598,11 +683,27 @@
 
 static void test_is_polymorphic ()
 {
+    // if we can reliably detect a class type, the fallback will evaluate
+    // to true for all polymorphic types. otherwise, it will evaluate to
+    // true for all class and union types.
+
+    TEST (std::is_polymorphic, void, false);
+    TEST (std::is_polymorphic, long, false);
+    TEST (std::is_polymorphic, int*, false);
+
     TEST (std::is_polymorphic, polymorphic_t, true);
     TEST (std::is_polymorphic, public_derived_t<polymorphic_t>, true);
 
+#if    defined (_RWSTD_TT_IS_POLYMORPHIC) \
+    || defined (_RWSTD_TT_IS_CLASS) \
+    || defined (_RWSTD_TT_IS_UNION)
     TEST (std::is_polymorphic, non_polymorphic_t, false);
     TEST (std::is_polymorphic, public_derived_t<non_polymorphic_t>, false);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_is_polymorphic() have been disabled "
+             "due to lack of compiler support.");
+#endif 
 
     TEST (std::is_polymorphic, abstract_t, true);
     TEST (std::is_polymorphic, public_derived_t<abstract_t>, true);
@@ -610,19 +711,57 @@
 
 static void test_is_abstract ()
 {
+    // if we can reliably detect a class type, the fallback will evaluate
+    // to true for all abstract types. otherwise, it will evaluate to
+    // true for all class and union types.
+
+    TEST (std::is_abstract, void, false);
+    TEST (std::is_abstract, long, false);
+    TEST (std::is_abstract, int*, false);
+
     TEST (std::is_abstract, abstract_t, true);
     TEST (std::is_abstract, public_derived_t<abstract_t>, true);
 
+#if    defined (_RWSTD_TT_IS_ABSTRACT) \
+    || defined (_RWSTD_TT_IS_CLASS) \
+    || defined (_RWSTD_TT_IS_UNION)
     TEST (std::is_abstract, polymorphic_t, false); // polymorphic_t is not an abstract type
     TEST (std::is_abstract, public_derived_t<polymorphic_t>, false);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_is_abstract() have been disabled "
+             "due to lack of compiler support.");
+#endif
 }
 
 static void test_has_trivial_constructor ()
 {
     TEST (std::has_trivial_default_constructor, long, true);
+    TEST (std::has_trivial_default_constructor, const long, true);
+    TEST (std::has_trivial_default_constructor, volatile long, true);
     TEST (std::has_trivial_default_constructor, long&, false);
-    TEST (std::has_trivial_default_constructor, long[2], true);
+    TEST (std::has_trivial_default_constructor, long [2], true);
+
+#if    defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
+    || defined (_RWSTD_TT_IS_POD)
     TEST (std::has_trivial_default_constructor, struct_t, true);
+    TEST (std::has_trivial_default_constructor, const struct_t, true);
+    TEST (std::has_trivial_default_constructor, volatile struct_t, true);
+    TEST (std::has_trivial_default_constructor, struct_t [2], true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_constructor() have been "
+             "disabled due to lack of compiler support.");
+#endif
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_CTOR)
+    TEST (std::has_trivial_default_constructor, no_trivial_assign_t, true);
+    TEST (std::has_trivial_default_constructor, no_trivial_dtor_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_constructor() have been "
+             "disabled due to lack of compiler support.");
+#endif
 
     TEST (std::has_trivial_default_constructor, no_trivial_ctor_t, false);
     TEST (std::has_trivial_default_constructor, public_derived_t<no_trivial_ctor_t>, false);
@@ -631,10 +770,33 @@
 static void test_has_trivial_copy ()
 {
     TEST (std::has_trivial_copy_constructor, long, true);
+    TEST (std::has_trivial_copy_constructor, const long, true);
+    TEST (std::has_trivial_copy_constructor, volatile long, true);
     TEST (std::has_trivial_copy_constructor, long&, true);
-    TEST (std::has_trivial_copy_constructor, long[2], true);
+    TEST (std::has_trivial_copy_constructor, long [2], false);
 
+#if    defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
+    || defined (_RWSTD_TT_IS_POD)
     TEST (std::has_trivial_copy_constructor, struct_t, true);
+    TEST (std::has_trivial_copy_constructor, const struct_t, true);
+    TEST (std::has_trivial_copy_constructor, volatile struct_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_copy() have been "
+             "disabled due to lack of compiler support.");
+#endif
+
+    TEST (std::has_trivial_copy_constructor, struct_t [2], false);
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_COPY)
+    TEST (std::has_trivial_copy_constructor, no_trivial_ctor_t, true);
+    TEST (std::has_trivial_copy_constructor, no_trivial_assign_t, true);
+    TEST (std::has_trivial_copy_constructor, no_trivial_dtor_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_copy() have been "
+             "disabled due to lack of compiler support.");
+#endif
 
     TEST (std::has_trivial_copy_constructor, no_trivial_copy_t, false);
     TEST (std::has_trivial_copy_constructor, public_derived_t<no_trivial_copy_t>, false);
@@ -643,9 +805,32 @@
 static void test_has_trivial_destructor ()
 {
     TEST (std::has_trivial_destructor, long, true);
+    TEST (std::has_trivial_destructor, const long, true);
+    TEST (std::has_trivial_destructor, volatile long, true);
     TEST (std::has_trivial_destructor, long&, true);
-    TEST (std::has_trivial_destructor, long[2], true);
+    TEST (std::has_trivial_destructor, long [2], true);
+
+#if    defined (_RWSTD_TT_HAS_TRIVIAL_DTOR) \
+    || defined (_RWSTD_TT_IS_POD)
     TEST (std::has_trivial_destructor, struct_t, true);
+    TEST (std::has_trivial_destructor, const struct_t, true);
+    TEST (std::has_trivial_destructor, volatile struct_t, true);
+    TEST (std::has_trivial_destructor, struct_t [2], true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_destructor() have been "
+             "disabled due to lack of compiler support.");
+#endif
+
+#if defined (_RWSTD_TT_HAS_TRIVIAL_DTOR)
+    TEST (std::has_trivial_destructor, no_trivial_ctor_t, true);
+    TEST (std::has_trivial_destructor, no_trivial_copy_t, true);
+    TEST (std::has_trivial_destructor, no_trivial_assign_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_trivial_destructor() have been "
+             "disabled due to lack of compiler support.");
+#endif
 
     TEST (std::has_trivial_destructor, no_trivial_dtor_t, false);
     TEST (std::has_trivial_destructor, public_derived_t<no_trivial_dtor_t>, false);
@@ -654,20 +839,70 @@
 static void test_has_nothrow_constructor ()
 {
     TEST (std::has_nothrow_default_constructor, long, true);
+    TEST (std::has_nothrow_default_constructor, const long, true);
+    TEST (std::has_nothrow_default_constructor, volatile long, true);
     TEST (std::has_nothrow_default_constructor, long&, false);
-    TEST (std::has_nothrow_default_constructor, long[2], true);
+    TEST (std::has_nothrow_default_constructor, long [2], true);
+
+#if    defined (_RWSTD_TT_HAS_NOTHROW_CTOR) \
+    || defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
+    || defined (_RWSTD_TT_IS_POD)
+    TEST (std::has_nothrow_default_constructor, struct_t, true);
+    TEST (std::has_nothrow_default_constructor, const struct_t, true);
+    TEST (std::has_nothrow_default_constructor, volatile struct_t, true);
+    TEST (std::has_nothrow_default_constructor, struct_t [2], true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_nothrow_constructor() have been "
+             "disabled due to lack of compiler support.");
+#endif
 
+#if defined (_RWSTD_TT_HAS_NOTHROW_CTOR)
+    TEST (std::has_nothrow_default_constructor, no_trivial_ctor_t, true);
+    //TEST (std::has_nothrow_default_constructor, no_trivial_copy_t, true);
+    TEST (std::has_nothrow_default_constructor, no_trivial_assign_t, true);
     TEST (std::has_nothrow_default_constructor, struct_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_nothrow_constructor() have been "
+             "disabled due to lack of compiler support.");
+#endif
+
     TEST (std::has_nothrow_default_constructor, throwing_ctor_t, false);
 }
 
 static void test_has_nothrow_copy ()
 {
     TEST (std::has_nothrow_copy_constructor, long, true);
+    TEST (std::has_nothrow_copy_constructor, const long, true);
+    TEST (std::has_nothrow_copy_constructor, volatile long, true);
     TEST (std::has_nothrow_copy_constructor, long&, true);
-    TEST (std::has_nothrow_copy_constructor, long[2], true);
+    TEST (std::has_nothrow_copy_constructor, long [2], false);
 
+#if    defined (_RWSTD_TT_HAS_NOTHROW_COPY) \
+    || defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
+    || defined (_RWSTD_TT_IS_POD)
     TEST (std::has_nothrow_copy_constructor, struct_t, true);
+    TEST (std::has_nothrow_copy_constructor, const struct_t, true);
+    TEST (std::has_nothrow_copy_constructor, volatile struct_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_nothrow_copy() have been "
+             "disabled due to lack of compiler support.");
+#endif
+
+    TEST (std::has_nothrow_copy_constructor, struct_t [2], false);
+
+#if defined (_RWSTD_TT_HAS_NOTHROW_COPY)
+    TEST (std::has_nothrow_copy_constructor, no_trivial_ctor_t, true);
+    TEST (std::has_nothrow_copy_constructor, no_trivial_copy_t, true);
+    TEST (std::has_nothrow_copy_constructor, no_trivial_assign_t, true);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_nothrow_copy() have been "
+             "disabled due to lack of compiler support.");
+#endif
+
     TEST (std::has_nothrow_copy_constructor, throwing_copy_t, false);
 }
 
@@ -679,8 +914,16 @@
     TEST (std::has_virtual_destructor, polymorphic_t, true);
     TEST (std::has_virtual_destructor, public_derived_t<polymorphic_t>, true);
 
+#if    defined (_RWSTD_TT_HAS_VIRTUAL_DTOR) \
+    || defined (_RWSTD_TT_IS_CLASS) \
+    || defined (_RWSTD_TT_IS_UNION)
     TEST (std::has_virtual_destructor, non_polymorphic_t, false);
     TEST (std::has_virtual_destructor, public_derived_t<non_polymorphic_t>, false);
+#else
+    rw_warn (0, 0, __LINE__,
+             "portions of test_has_virtual_destructor() have been "
+             "disabled due to lack of compiler support.");
+#endif
 }
 
 static void test_is_signed ()
@@ -704,14 +947,20 @@
 
     TEST (std::is_signed, float, true);
     TEST (std::is_signed, double, true);
+
+#ifndef _RWSTD_NO_LONG_DOUBLE
     TEST (std::is_signed, long double, true);
+#endif
 
     TEST (std::is_signed, enum_t, false);
     TEST (std::is_signed, struct_t, false);
     TEST (std::is_signed, class_t, false);
     TEST (std::is_signed, union_t, false);
 
-    // add tests for references, pointers, arrays and functions
+    TEST (std::is_signed, long&, false);
+    TEST (std::is_signed, long*, false);
+    TEST (std::is_signed, long [2], false);
+    TEST (std::is_signed, long (), false);
 }
 
 static void test_is_unsigned ()
@@ -735,16 +984,69 @@
 
     TEST (std::is_unsigned, float, false);
     TEST (std::is_unsigned, double, false);
+
+#ifndef _RWSTD_NO_LONG_DOUBLE
     TEST (std::is_unsigned, long double, false);
+#endif
 
     TEST (std::is_unsigned, enum_t, false);
     TEST (std::is_unsigned, struct_t, false);
     TEST (std::is_unsigned, class_t, false);
     TEST (std::is_unsigned, union_t, false);
+
+    TEST (std::is_unsigned, unsigned long&, false);
+    TEST (std::is_unsigned, unsigned long*, false);
+    TEST (std::is_unsigned, unsigned long [2], false);
+    TEST (std::is_unsigned, unsigned long (), false);
 }
 
 static void test_alignment_of ()
 {
+#ifdef _RWSTD_NO_ALIGN_TRAITS
+
+    rw_warn (0, 0, __LINE__,
+             "test_alignment_of() disabled because "
+             "_RWSTD_NO_ALIGN_TRAITS is defined");
+
+#else 
+
+#  undef TEST
+#  define TEST(Trait,Type)                                           \
+     test_trait (__LINE__, #Trait, #Type,                            \
+                 Trait<Type>::value, _RWSTD_TT_ALIGN_OF(Type))
+
+    TEST (std::alignment_of, signed char);
+    TEST (std::alignment_of, signed short);
+    TEST (std::alignment_of, signed int);
+    TEST (std::alignment_of, signed long);
+
+    TEST (std::alignment_of, unsigned char);
+    TEST (std::alignment_of, unsigned short);
+    TEST (std::alignment_of, unsigned int);
+    TEST (std::alignment_of, unsigned long);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::alignment_of, signed long long);
+    TEST (std::alignment_of, unsigned long long);
+#endif
+
+    TEST (std::alignment_of, float);
+    TEST (std::alignment_of, double);
+
+#ifndef _RWSTD_NO_LONG_DOUBLE 
+    TEST (std::alignment_of, long double);
+#endif
+
+    TEST (std::alignment_of, enum_t);
+    TEST (std::alignment_of, struct_t);
+    TEST (std::alignment_of, class_t);
+    TEST (std::alignment_of, union_t);
+    TEST (std::alignment_of, polymorphic_t);
+
+    TEST (std::alignment_of, void*);
+
+#  undef TEST
+#endif  // _RWSTD_TT_ALIGN_OF
 }
 
 static void test_rank ()
@@ -790,7 +1092,7 @@
 #undef TEST
 }
 
-static int run_test (int, char*[])
+static int run_test (int, char* [])
 {
     test_is_const ();
     test_is_volatile ();
@@ -823,7 +1125,7 @@
 
 /**************************************************************************/
 
-static int run_test (int, char*[])
+static int run_test (int, char* [])
 {
     rw_warn (0, 0, __LINE__,
              "test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
@@ -834,7 +1136,7 @@
 
 /**************************************************************************/
 
-int main (int argc, char*argv[])
+int main (int argc, char* argv [])
 {
     return rw_test (argc, argv, __FILE__,
                     "meta.unary.prop",



Mime
View raw message