stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r676102 - in /stdcxx/branches/4.3.x: include/rw/_config-eccp.h include/rw/_meta_prop.h tests/utilities/20.meta.trans.other.cpp tests/utilities/20.meta.unary.prop.cpp
Date Fri, 11 Jul 2008 23:58:14 GMT
Author: vitek
Date: Fri Jul 11 16:58:13 2008
New Revision: 676102

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

	STDCXX-916
	* include/rw/_meta_prop.h (__rw_is_pod_impl): Remove cv-qualifiers
	on types.
	[__EDG_VERSION__]: Work around incorrect __is_pod(),
	__has_trivial_constructor(), __has_trivial_assign(),
	__has_trivial_copy(), __has_trivial_destructor(),
	__has_nothrow_constructor(), __has_nothrow_assign(),
	__has_nothrow_copy(), __is_empty().
	* include/rw/_config-eccp.h [__EDG_VERSION__]: Define helper macros
	for built-in trait names.
	* tests/utilities/20.meta.trans.other.cpp (_cond_if_char): Change
	linkage so that function is found when instantiating cond_if_char.
	* tests/utilities/20.meta.unary.prop.cpp: Add constructor to type
	member_t.
	[_RWSTD_NO_LONG_LONG]: Guard code using long long to avoid compile
	error when type is not supported.


Modified:
    stdcxx/branches/4.3.x/include/rw/_config-eccp.h
    stdcxx/branches/4.3.x/include/rw/_meta_prop.h
    stdcxx/branches/4.3.x/tests/utilities/20.meta.trans.other.cpp
    stdcxx/branches/4.3.x/tests/utilities/20.meta.unary.prop.cpp

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=676102&r1=676101&r2=676102&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_config-eccp.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_config-eccp.h Fri Jul 11 16:58:13 2008
@@ -66,3 +66,33 @@
 #    define _RWSTD_NO_EXCEPTIONS
 #  endif   // _RWSTD_NO_EXCEPTIONS
 #endif   // __EXCEPTIONS
+
+#if (310 <= __EDG_VERSION__)
+#  define _RWSTD_TT_IS_ENUM(T)              __is_enum(T)
+#  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)
+#  define _RWSTD_TT_IS_POLYMORPHIC(T)       __is_polymorphic(T)
+#  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)
+
+#  define _RWSTD_TT_HAS_TRIVIAL_CTOR(T)     __has_trivial_constructor(T)
+#  define _RWSTD_TT_HAS_TRIVIAL_COPY(T)     __has_trivial_copy(T)
+#  define _RWSTD_TT_HAS_TRIVIAL_ASSIGN(T)   __has_trivial_assign(T)
+#  define _RWSTD_TT_HAS_TRIVIAL_DTOR(T)     __has_trivial_destructor(T)
+
+#  define _RWSTD_TT_HAS_NOTHROW_CTOR(T)     __has_nothrow_constructor(T)
+#  define _RWSTD_TT_HAS_NOTHROW_COPY(T)     __has_nothrow_copy(T)
+#  define _RWSTD_TT_HAS_NOTHROW_ASSIGN(T)   __has_nothrow_assign(T)
+
+#  define _RWSTD_TT_HAS_VIRTUAL_DTOR(T)     __has_virtual_destructor(T)
+
+#  define _RWSTD_TT_ALIGN_OF(T)             __alignof__(T)
+#  define _RWSTD_TT_MAX_ALIGNMENT           16
+
+// need to find a way to align data
+#  define _RWSTD_TT_ALIGNED_POD(N)          struct { double _C_align; }
+#endif   // __EDG_VERSION__ >= 3.10 
+

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=676102&r1=676101&r2=676102&view=diff
==============================================================================
--- stdcxx/branches/4.3.x/include/rw/_meta_prop.h (original)
+++ stdcxx/branches/4.3.x/include/rw/_meta_prop.h Fri Jul 11 16:58:13 2008
@@ -32,6 +32,7 @@
 
 #include <rw/_defs.h>
 #include <rw/_meta_cat.h>
+#include <rw/_meta_comp.h>
 #include <rw/_meta_arr.h>
 #include <rw/_meta_cv.h>
 
@@ -75,27 +76,24 @@
 template <class _TypeT>
 struct __rw_is_pod_impl
 {
-    typedef typename
-    __rw_remove_all_extents<_TypeT>::type _TypeU;
-
-    typedef typename
-    __rw_remove_cv<_TypeU>::type _NoCV_TypeU;
+    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 };
 };
 
 #    define _RWSTD_TT_IS_POD(T) _RW::__rw_is_pod_impl<T>::_C_value
-#elif defined (_MSC_VER)
+#elif defined (_MSC_VER) || defined (__EDG_VERSION__)
 
 template <class _TypeT>
 struct __rw_is_pod_impl
 {
-    typedef typename __rw_remove_cv<_TypeT> _TypeU;
-    typedef typename __rw_remove_all_extents<_TypeT>::type _TypeV;
+    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
-    enum { _C_value =    __rw_is_scalar<_TypeV>::value
-                      || _RWSTD_TT_IS_POD(_TypeV) };
+    enum { _C_value =    __rw_is_scalar<_NoCV_TypeU>::value
+                      || _RWSTD_TT_IS_POD(_NoCV_TypeU) };
 };
 
 #  undef  _RWSTD_TT_IS_POD
@@ -112,7 +110,7 @@
 
 
 #ifndef _RWSTD_TT_IS_STANDARD_LAYOUT
-#  define _RWSTD_TT_IS_STANDARD_LAYOUT(T) _RWSTD_TT_IS_POD(T)
+#  define _RWSTD_TT_IS_STANDARD_LAYOUT(T) _RWSTD_IS_POD(T)
 #endif // _RWSTD_TT_IS_STANDARD_LAYOUT
 
 template <class _TypeT>
@@ -154,7 +152,7 @@
 };
 
 #  define _RWSTD_TT_IS_EMPTY(T) _RW::__rw_is_empty_impl<T>::_C_value
-#elif defined (_MSC_VER)
+#elif defined (_MSC_VER) || defined (__EDG_VERSION__)
 
 template <class _TypeT>
 struct __rw_is_empty_impl
@@ -166,7 +164,7 @@
 
 #  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
+#endif // !_RWSTD_TT_IS_EMPTY || _MSC_VER || __EDG_VERSION__
 
 template <class _TypeT>
 struct __rw_is_empty
@@ -280,7 +278,22 @@
 #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
-#endif // _RWSTD_TT_HAS_TRIVIAL_CTOR
+#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) };
+};
+
+#  undef _RWSTD_TT_HAS_TRIVIAL_CTOR
+#  define _RWSTD_TT_HAS_TRIVIAL_CTOR(T) \
+     _RW::__rw_has_trivial_ctor_impl<T>::_C_value
+#endif // !_RWSTD_TT_HAS_TRIVIAL_CTOR || __EDG_VERSION
 
 template <class _TypeT>
 struct __rw_has_trivial_ctor
@@ -296,7 +309,22 @@
 #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
-#endif // _RWSTD_TT_HAS_TRIVIAL_COPY
+#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__
 
 template <class _TypeT>
 struct __rw_has_trivial_copy
@@ -308,12 +336,27 @@
 
 
 
-
 #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
-#endif // _RWSTD_TT_HAS_TRIVIAL_ASSIGN
+#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__
 
 template <class _TypeT>
 struct __rw_has_trivial_assign
@@ -329,7 +372,24 @@
 #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
-#endif // _RWSTD_TT_HAS_TRIVIAL_DTOR
+#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) };
+};
+
+#  undef _RWSTD_TT_HAS_TRIVIAL_DTOR
+#  define _RWSTD_TT_HAS_TRIVIAL_DTOR(T) \
+    _RW::__rw_has_trivial_dtor_impl<T>::_C_value
+
+#endif // !_RWSTD_TT_HAS_TRIVIAL_DTOR || __EDG_VERSION__
 
 template <class _TypeT>
 struct __rw_has_trivial_dtor
@@ -343,11 +403,8 @@
 template <class _TypeT>
 struct __rw_is_trivial_impl
 {
-    typedef typename
-    __rw_remove_cv<_TypeT>::type _NoCV_TypeT;
-
-    typedef typename
-    __rw_remove_all_extents<_NoCV_TypeT>::type _NoCV_TypeU;
+    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_has_trivial_ctor<_NoCV_TypeU>::value
@@ -370,7 +427,21 @@
 
 #ifndef _RWSTD_TT_HAS_NOTHROW_CTOR
 #  define _RWSTD_TT_HAS_NOTHROW_CTOR(T) _RW::__rw_has_trivial_ctor<T>::value
-#endif //_RWSTD_TT_HAS_NOTHROW_CTOR
+#elif defined (__EDG_VERSION__)
+
+template <class _TypeT>
+struct __rw_has_nothrow_ctor_impl
+{
+    typedef typename __rw_remove_all_extents<_TypeT>::type _TypeU;
+
+    enum { _C_value =    __rw_has_trivial_ctor<_TypeT>::value
+                      || _RWSTD_TT_HAS_NOTHROW_CTOR (_TypeU) };
+};
+
+#  undef _RWSTD_TT_HAS_NOTHROW_CTOR
+#  define _RWSTD_TT_HAS_NOTHROW_CTOR(T) \
+     _RW::__rw_has_nothrow_ctor_impl<T>::_C_value
+#endif // !_RWSTD_TT_HAS_NOTHROW_CTOR || __EDG_VERSION__
 
 template <class _TypeT>
 struct __rw_has_nothrow_ctor
@@ -384,7 +455,21 @@
 
 #ifndef _RWSTD_TT_HAS_NOTHROW_COPY
 #  define _RWSTD_TT_HAS_NOTHROW_COPY(T) _RW::__rw_has_trivial_copy<T>::value
-#endif // _RWSTD_TT_HAS_NOTHROW_COPY
+#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__
 
 template <class _TypeT>
 struct __rw_has_nothrow_copy
@@ -399,7 +484,23 @@
 
 #ifndef _RWSTD_TT_HAS_NOTHROW_ASSIGN
 #  define _RWSTD_TT_HAS_NOTHROW_ASSIGN(T) _RW::__rw_has_trivial_assign<T>::value
-#endif // _RWSTD_TT_HAS_NOTHROW_ASSIGN
+#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__
 
 template <class _TypeT>
 struct __rw_has_nothrow_assign

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=676102&r1=676101&r2=676102&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 Fri Jul 11 16:58:13 2008
@@ -70,12 +70,14 @@
     return 0;
 }
 
-static int _cond_if_char (void* = 0)
+// must have external linkage
+int _cond_if_char (void*)
 {
     return 0;
 }
 
-static int _cond_if_char (long* = 0)
+// must have external linkage
+int _cond_if_char (long*)
 {
     return 1;
 }

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=676102&r1=676101&r2=676102&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 Fri Jul 11 16:58:13 2008
@@ -96,6 +96,7 @@
 template <class T>
 struct member_t
 {
+    member_t (T);
     T val;
 };
 
@@ -690,13 +691,16 @@
     TEST (std::is_signed, signed short, true);
     TEST (std::is_signed, signed int, true);
     TEST (std::is_signed, signed long, true);
-    TEST (std::is_signed, signed long long, true);
 
     TEST (std::is_signed, unsigned char, false);
     TEST (std::is_signed, unsigned short, false);
     TEST (std::is_signed, unsigned int, false);
     TEST (std::is_signed, unsigned long, false);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_signed,   signed long long, true);
     TEST (std::is_signed, unsigned long long, false);
+#endif
 
     TEST (std::is_signed, float, true);
     TEST (std::is_signed, double, true);
@@ -718,13 +722,16 @@
     TEST (std::is_unsigned, signed short, false);
     TEST (std::is_unsigned, signed int, false);
     TEST (std::is_unsigned, signed long, false);
-    TEST (std::is_unsigned, signed long long, false);
 
     TEST (std::is_unsigned, unsigned char, true);
     TEST (std::is_unsigned, unsigned short, true);
     TEST (std::is_unsigned, unsigned int, true);
     TEST (std::is_unsigned, unsigned long, true);
+
+#ifndef _RWSTD_NO_LONG_LONG
+    TEST (std::is_unsigned, signed long long, false);
     TEST (std::is_unsigned, unsigned long long, true);
+#endif
 
     TEST (std::is_unsigned, float, false);
     TEST (std::is_unsigned, double, false);



Mime
View raw message