[cfe-commits] [libcxx] r131291 - in /libcxx/trunk: include/ test/utilities/meta/meta.hel/ test/utilities/meta/meta.trans/meta.trans.other/ test/utilities/meta/meta.unary/meta.unary.prop/

Howard Hinnant hhinnant at apple.com
Fri May 13 07:08:16 PDT 2011


Author: hhinnant
Date: Fri May 13 09:08:16 2011
New Revision: 131291

URL: http://llvm.org/viewvc/llvm-project?rev=131291&view=rev
Log:
A much improved type_traits for C++0x.  Not yet done: is_trivially_constructible, is_trivially_assignable and underlying_type.

Removed:
    libcxx/trunk/test/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
Modified:
    libcxx/trunk/include/type_traits
    libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp
    libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp

Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Fri May 13 09:08:16 2011
@@ -129,7 +129,6 @@
     template <class T> struct alignment_of;
     template <size_t Len, size_t Align = most_stringent_alignment_requirement>
         struct aligned_storage;
-    template <std::size_t Len, class... Types> struct aligned_union;
 
     template <class T> struct decay;
     template <class... T> struct common_type;
@@ -169,11 +168,15 @@
 #ifndef _LIBCPP_HAS_NO_CONSTEXPR
     constexpr
 #endif
-         operator value_type() const {return value;}
+         operator value_type()
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
+                               const
+#endif
+                                     {return value;}
 };
 
 template <class _Tp, _Tp __v>
-const _Tp integral_constant<_Tp, __v>::value;
+constexpr _Tp integral_constant<_Tp, __v>::value;
 
 typedef integral_constant<bool, true>  true_type;
 typedef integral_constant<bool, false> false_type;
@@ -1200,7 +1203,7 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 __is_assignable_test(_Tp&&, _Arg&&);
 #else
-__is_assignable_test(_Tp&, _Arg&);
+__is_assignable_test(_Tp, _Arg&);
 #endif
 
 template <class _Arg>
@@ -1211,7 +1214,7 @@
 __is_assignable_test(__any, _Arg&);
 #endif
 
-template <class _Tp, class _Arg>
+template <class _Tp, class _Arg, bool = is_void<_Tp>::value || is_void<_Arg>::value>
 struct __is_assignable_imp
     : public common_type
         <
@@ -1219,19 +1222,27 @@
         >::type {};
 
 template <class _Tp, class _Arg>
+struct __is_assignable_imp<_Tp, _Arg, true>
+    : public false_type
+{
+};
+
+template <class _Tp, class _Arg>
 struct is_assignable
     : public __is_assignable_imp<_Tp, _Arg> {};
 
 // is_copy_assignable
 
 template <class _Tp> struct _LIBCPP_VISIBLE is_copy_assignable
-    : public is_assignable<_Tp&, const _Tp&> {};
+    : public is_assignable<typename add_lvalue_reference<_Tp>::type,
+                     const typename add_lvalue_reference<_Tp>::type> {};
 
 // is_move_assignable
 
 template <class _Tp> struct _LIBCPP_VISIBLE is_move_assignable
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-    : public is_assignable<_Tp&, _Tp&&> {};
+    : public is_assignable<typename add_lvalue_reference<_Tp>::type,
+                     const typename add_rvalue_reference<_Tp>::type> {};
 #else
     : public is_copy_assignable<_Tp> {};
 #endif
@@ -2143,6 +2154,12 @@
 {
 };
 
+template <class _Tp, size_t _Ns>
+struct _LIBCPP_VISIBLE is_nothrow_constructible<_Tp[_Ns]>
+    : __is_nothrow_constructible<is_constructible<_Tp>::value, _Tp>
+{
+};
+
 #else  // __has_feature(cxx_noexcept)
 
 template <class _Tp, class... _Args>
@@ -2384,6 +2401,28 @@
 {
 };
 
+template <class _Tp, size_t _Ns>
+struct _LIBCPP_VISIBLE is_nothrow_destructible<_Tp[_Ns]>
+    : public is_nothrow_destructible<_Tp>
+{
+};
+
+template <class _Tp>
+struct _LIBCPP_VISIBLE is_nothrow_destructible<_Tp&>
+    : public true_type
+{
+};
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+template <class _Tp>
+struct _LIBCPP_VISIBLE is_nothrow_destructible<_Tp&&>
+    : public true_type
+{
+};
+
+#endif
+
 #else
 
 template <class _Tp> struct __libcpp_nothrow_destructor
@@ -2423,6 +2462,37 @@
 #endif
     {};
     
+// is_standard_layout;
+
+template <class _Tp> struct _LIBCPP_VISIBLE is_standard_layout
+#if __has_feature(is_standard_layout)
+    : public integral_constant<bool, __is_standard_layout(_Tp)>
+#else
+    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
+#endif
+    {};
+    
+// is_trivially_copyable;
+
+template <class _Tp> struct _LIBCPP_VISIBLE is_trivially_copyable
+#if __has_feature(is_trivially_copyable)
+    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
+#else
+    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
+#endif
+    {};
+    
+// is_trivial;
+
+template <class _Tp> struct _LIBCPP_VISIBLE is_trivial
+#if __has_feature(is_trivial)
+    : public integral_constant<bool, __is_trivial(_Tp)>
+#else
+    : integral_constant<bool, is_trivially_copyable<_Tp>::value &&
+                           is_trivially_default_constructible<T>::value>::value>
+#endif
+    {};
+    
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
 void

Modified: libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.hel/integral_constant.pass.cpp Fri May 13 09:08:16 2011
@@ -20,7 +20,11 @@
     static_assert(_5::value == 5, "");
     static_assert((std::is_same<_5::value_type, int>::value), "");
     static_assert((std::is_same<_5::type, _5>::value), "");
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     static_assert((_5() == 5), "");
+#else
+    assert(_5() == 5);
+#endif
 
     static_assert(std::false_type::value == false, "");
     static_assert((std::is_same<std::false_type::value_type, bool>::value), "");

Removed: libcxx/trunk/test/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp?rev=131290&view=auto
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp (removed)
@@ -1,19 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// type_traits
-
-// aligned_union
-
-#include <type_traits>
-
-int main()
-{
-#error aligned_union is not implemented
-}

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp Fri May 13 09:08:16 2011
@@ -31,4 +31,8 @@
     static_assert(( std::is_assignable<int&, double>::value), "");
     static_assert(( std::is_assignable<B, A>::value), "");
     static_assert((!std::is_assignable<A, B>::value), "");
+    static_assert((!std::is_assignable<void, const void>::value), "");
+    static_assert((!std::is_assignable<const void, const void>::value), "");
+    static_assert(( std::is_assignable<void*&, void*>::value), "");
+    static_assert((!std::is_assignable<int(), int>::value), "");
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp Fri May 13 09:08:16 2011
@@ -18,6 +18,8 @@
 {
     explicit A(int);
     A(int, double);
+private:
+    A(char);
 };
 
 int main()
@@ -27,4 +29,9 @@
     static_assert((std::is_constructible<A, int>::value), "");
     static_assert((std::is_constructible<A, int, double>::value), "");
     static_assert((!std::is_constructible<A>::value), "");
+    static_assert((!std::is_constructible<A, char>::value), "");
+    static_assert((!std::is_constructible<A, void>::value), "");
+    static_assert((!std::is_constructible<void>::value), "");
+    static_assert((!std::is_constructible<int&>::value), "");
+    static_assert(( std::is_constructible<int&, int&>::value), "");
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_assignable.pass.cpp Fri May 13 09:08:16 2011
@@ -35,6 +35,11 @@
     A();
 };
 
+class B
+{
+    B& operator=(const B&);
+};
+
 int main()
 {
     static_assert(( std::is_copy_assignable<int>::value), "");
@@ -47,4 +52,6 @@
     static_assert(( std::is_copy_assignable<Union>::value), "");
     static_assert(( std::is_copy_assignable<NotEmpty>::value), "");
     static_assert(( std::is_copy_assignable<Empty>::value), "");
+    static_assert((!std::is_copy_assignable<B>::value), "");
+    static_assert((!std::is_copy_assignable<void>::value), "");
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_copy_constructible.pass.cpp Fri May 13 09:08:16 2011
@@ -47,6 +47,11 @@
     A(const A&);
 };
 
+class B
+{
+    B(const B&);
+};
+
 int main()
 {
     test_is_copy_constructible<char[3], false>();
@@ -55,6 +60,7 @@
     test_is_copy_constructible<Abstract, false>();
 
     test_is_copy_constructible<A, true>();
+    test_is_copy_constructible<B, false>();
     test_is_copy_constructible<int&, true>();
     test_is_copy_constructible<Union, true>();
     test_is_copy_constructible<Empty, true>();

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_default_constructible.pass.cpp Fri May 13 09:08:16 2011
@@ -50,6 +50,11 @@
     A();
 };
 
+class B
+{
+    B();
+};
+
 int main()
 {
     test_is_default_constructible<void, false>();
@@ -58,6 +63,7 @@
     test_is_default_constructible<Abstract, false>();
 
     test_is_default_constructible<A, true>();
+    test_is_default_constructible<B, false>();
     test_is_default_constructible<Union, true>();
     test_is_default_constructible<Empty, true>();
     test_is_default_constructible<int, true>();

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_literal_type.pass.cpp Fri May 13 09:08:16 2011
@@ -13,10 +13,21 @@
 
 #include <type_traits>
 
+struct A
+{
+};
+
+struct B
+{
+    B();
+};
+
 int main()
 {
     static_assert( std::is_literal_type<int>::value, "");
     static_assert( std::is_literal_type<const int>::value, "");
-    static_assert(!std::is_literal_type<int&>::value, "");
-    static_assert(!std::is_literal_type<volatile int&>::value, "");
+    static_assert( std::is_literal_type<int&>::value, "");
+    static_assert( std::is_literal_type<volatile int&>::value, "");
+    static_assert( std::is_literal_type<A>::value, "");
+    static_assert(!std::is_literal_type<B>::value, "");
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp Fri May 13 09:08:16 2011
@@ -41,7 +41,8 @@
     static_assert((!std::is_move_assignable<const int>::value), "");
     static_assert((!std::is_move_assignable<int[]>::value), "");
     static_assert((!std::is_move_assignable<int[3]>::value), "");
-    static_assert(( std::is_move_assignable<int&>::value), "");
+    static_assert((!std::is_move_assignable<int[3]>::value), "");
+    static_assert((!std::is_move_assignable<void>::value), "");
     static_assert(( std::is_move_assignable<A>::value), "");
     static_assert(( std::is_move_assignable<bit_zero>::value), "");
     static_assert(( std::is_move_assignable<Union>::value), "");

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp Fri May 13 09:08:16 2011
@@ -47,4 +47,6 @@
     static_assert((!std::is_nothrow_constructible<A, int>::value), "");
     static_assert((!std::is_nothrow_constructible<A, int, double>::value), "");
     static_assert((!std::is_nothrow_constructible<A>::value), "");
+    static_assert(( std::is_nothrow_constructible<Empty>::value), "");
+    static_assert(( std::is_nothrow_constructible<Empty, const Empty&>::value), "");
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_assignable.pass.cpp Fri May 13 09:08:16 2011
@@ -42,6 +42,7 @@
 
 int main()
 {
+    test_has_nothrow_assign<const int, false>();
     test_has_nothrow_assign<void, false>();
     test_has_nothrow_assign<A, false>();
     test_has_nothrow_assign<int&, true>();

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_copy_constructible.pass.cpp Fri May 13 09:08:16 2011
@@ -18,8 +18,6 @@
 {
     static_assert( std::is_nothrow_copy_constructible<T>::value, "");
     static_assert( std::is_nothrow_copy_constructible<const T>::value, "");
-    static_assert( std::is_nothrow_copy_constructible<volatile T>::value, "");
-    static_assert( std::is_nothrow_copy_constructible<const volatile T>::value, "");
 }
 
 template <class T>
@@ -35,12 +33,6 @@
 {
 };
 
-class NotEmpty
-{
-public:
-    virtual ~NotEmpty();
-};
-
 union Union {};
 
 struct bit_zero
@@ -65,6 +57,5 @@
     test_is_nothrow_copy_constructible<double>();
     test_is_nothrow_copy_constructible<int*>();
     test_is_nothrow_copy_constructible<const int*>();
-    test_is_nothrow_copy_constructible<NotEmpty>();
     test_is_nothrow_copy_constructible<bit_zero>();
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_default_constructible.pass.cpp Fri May 13 09:08:16 2011
@@ -35,12 +35,6 @@
 {
 };
 
-class NotEmpty
-{
-public:
-    virtual ~NotEmpty();
-};
-
 union Union {};
 
 struct bit_zero
@@ -66,6 +60,5 @@
     test_is_nothrow_default_constructible<int*>();
     test_is_nothrow_default_constructible<const int*>();
     test_is_nothrow_default_constructible<char[3]>();
-    test_is_nothrow_default_constructible<NotEmpty>();
     test_is_nothrow_default_constructible<bit_zero>();
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_move_constructible.pass.cpp Fri May 13 09:08:16 2011
@@ -18,8 +18,6 @@
 {
     static_assert( std::is_nothrow_move_constructible<T>::value, "");
     static_assert( std::is_nothrow_move_constructible<const T>::value, "");
-    static_assert( std::is_nothrow_move_constructible<volatile T>::value, "");
-    static_assert( std::is_nothrow_move_constructible<const volatile T>::value, "");
 }
 
 template <class T>
@@ -35,12 +33,6 @@
 {
 };
 
-class NotEmpty
-{
-public:
-    virtual ~NotEmpty();
-};
-
 union Union {};
 
 struct bit_zero
@@ -58,13 +50,12 @@
     test_has_not_nothrow_move_constructor<void>();
     test_has_not_nothrow_move_constructor<A>();
 
-    test_has_not_nothrow_move_constructor<int&>();
+    test_is_nothrow_move_constructible<int&>();
     test_is_nothrow_move_constructible<Union>();
     test_is_nothrow_move_constructible<Empty>();
     test_is_nothrow_move_constructible<int>();
     test_is_nothrow_move_constructible<double>();
     test_is_nothrow_move_constructible<int*>();
     test_is_nothrow_move_constructible<const int*>();
-    test_is_nothrow_move_constructible<NotEmpty>();
     test_is_nothrow_move_constructible<bit_zero>();
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_standard_layout.pass.cpp Fri May 13 09:08:16 2011
@@ -13,9 +13,18 @@
 
 #include <type_traits>
 
+template <class T1, class T2>
+struct pair
+{
+    T1 first;
+    T2 second;
+};
+
 int main()
 {
     static_assert( std::is_standard_layout<int>::value, "");
+    static_assert( std::is_standard_layout<int[3]>::value, "");
     static_assert(!std::is_standard_layout<int&>::value, "");
     static_assert(!std::is_standard_layout<volatile int&>::value, "");
+    static_assert(( std::is_standard_layout<pair<int, double> >::value), "");
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivial.pass.cpp Fri May 13 09:08:16 2011
@@ -13,9 +13,19 @@
 
 #include <type_traits>
 
+struct A {};
+
+class B
+{
+public:
+    B();
+};
+
 int main()
 {
     static_assert( std::is_trivial<int>::value, "");
     static_assert(!std::is_trivial<int&>::value, "");
     static_assert(!std::is_trivial<volatile int&>::value, "");
+    static_assert( std::is_trivial<A>::value, "");
+    static_assert(!std::is_trivial<B>::value, "");
 }

Modified: libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp?rev=131291&r1=131290&r2=131291&view=diff
==============================================================================
--- libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp (original)
+++ libcxx/trunk/test/utilities/meta/meta.unary/meta.unary.prop/is_trivialially_copyable.pass.cpp Fri May 13 09:08:16 2011
@@ -25,6 +25,12 @@
     ~B() {assert(i_ == 0);}
 };
 
+class C
+{
+public:
+    C();
+};
+
 int main()
 {
     static_assert( std::is_trivially_copyable<int>::value, "");
@@ -34,4 +40,5 @@
     static_assert( std::is_trivially_copyable<const A>::value, "");
     static_assert(!std::is_trivially_copyable<const A&>::value, "");
     static_assert(!std::is_trivially_copyable<B>::value, "");
+    static_assert( std::is_trivially_copyable<C>::value, "");
 }





More information about the cfe-commits mailing list