[libcxx] r261925 - Added tests to make sure that the categorization traits work on incomplete types

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 25 12:15:48 PST 2016


Author: marshall
Date: Thu Feb 25 14:15:47 2016
New Revision: 261925

URL: http://llvm.org/viewvc/llvm-project?rev=261925&view=rev
Log:
Added tests to make sure that the categorization traits work on incomplete types

Modified:
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp
    libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/array.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // array
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_array_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -46,10 +47,14 @@ void test_array()
 typedef char array[3];
 typedef const char const_array[3];
 typedef char incomplete_array[];
+struct incomplete_type;
 
 int main()
 {
     test_array<array>();
     test_array<const_array>();
     test_array<incomplete_array>();
+
+//  LWG#2581
+    static_assert(!std::is_array<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/class.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // class
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_class_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -47,7 +48,12 @@ class Class
 {
 };
 
+struct incomplete_type;
+
 int main()
 {
     test_class<Class>();
+
+//  LWG#2581
+    static_assert( std::is_class<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/enum.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // enum
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_enum_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -44,8 +45,12 @@ void test_enum()
 }
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 int main()
 {
     test_enum<Enum>();
+
+//  LWG#2581
+    static_assert(!std::is_enum<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/floating_point.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // floating_point
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_floating_point_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -43,9 +44,14 @@ void test_floating_point()
     test_floating_point_imp<const volatile T>();
 }
 
+struct incomplete_type;
+
 int main()
 {
     test_floating_point<float>();
     test_floating_point<double>();
     test_floating_point<long double>();
+
+//  LWG#2581
+    static_assert(!std::is_floating_point<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/function.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,13 +12,14 @@
 // function
 
 #include <type_traits>
+#include "test_macros.h"
 
 using namespace std;
 
 class Class {};
 
 enum Enum1 {};
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
 enum class Enum2 : int {};
 #else
 enum Enum2 {};
@@ -28,7 +29,7 @@ template <class T>
 void test()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -64,6 +65,7 @@ void test()
     test<__VA_ARGS__ volatile &&>();      \
     test<__VA_ARGS__ const volatile &&>()
 
+struct incomplete_type;
 
 int main()
 {
@@ -75,7 +77,7 @@ int main()
     TEST_REGULAR( void (int, ...) );
     TEST_REGULAR( int (double, ...) );
     TEST_REGULAR( int (double, char, ...) );
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
     TEST_REF_QUALIFIED( void () );
     TEST_REF_QUALIFIED( void (int) );
     TEST_REF_QUALIFIED( int (double) );
@@ -85,4 +87,7 @@ int main()
     TEST_REF_QUALIFIED( int (double, ...) );
     TEST_REF_QUALIFIED( int (double, char, ...) );
 #endif
+
+//  LWG#2581
+    static_assert(!std::is_function<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/integral.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // integral
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_integral_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert( std::is_integral<T>::value, "");
@@ -43,6 +44,8 @@ void test_integral()
     test_integral_imp<const volatile T>();
 }
 
+struct incomplete_type;
+
 int main()
 {
     test_integral<bool>();
@@ -62,4 +65,7 @@ int main()
     test_integral<__int128_t>();
     test_integral<__uint128_t>();
 #endif
+
+//  LWG#2581
+    static_assert(!std::is_integral<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_array.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -89,5 +90,5 @@ int main()
     test_is_not_array<Empty>();
     test_is_not_array<bit_zero>();
     test_is_not_array<NotEmpty>();
-    test_is_not_array<Abstract>();
+    test_is_not_array<incomplete_type>();  //  LWG#2581
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_class.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -76,6 +77,7 @@ int main()
     test_is_class<bit_zero>();
     test_is_class<NotEmpty>();
     test_is_class<Abstract>();
+    test_is_class<incomplete_type>();
 
 #if TEST_STD_VER >= 11
 // In C++03 we have an emulation of std::nullptr_t

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_enum.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -90,4 +91,5 @@ int main()
     test_is_not_enum<NotEmpty>();
     test_is_not_enum<Abstract>();
     test_is_not_enum<FunctionPtr>();
+    test_is_not_enum<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_floating_point.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -98,4 +99,5 @@ int main()
     test_is_not_floating_point<Abstract>();
     test_is_not_floating_point<Enum>();
     test_is_not_floating_point<FunctionPtr>();
+    test_is_not_floating_point<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -95,4 +96,5 @@ int main()
     test_is_not_function<NotEmpty>();
     test_is_not_function<Abstract>();
     test_is_not_function<Abstract*>();
+    test_is_not_function<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_integral.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -101,4 +102,5 @@ int main()
     test_is_not_integral<bit_zero>();
     test_is_not_integral<NotEmpty>();
     test_is_not_integral<Abstract>();
+    test_is_not_integral<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_lvalue_reference.pass.cpp Thu Feb 25 14:15:47 2016
@@ -69,6 +69,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -92,4 +93,5 @@ int main()
     test_is_not_lvalue_reference<bit_zero>();
     test_is_not_lvalue_reference<NotEmpty>();
     test_is_not_lvalue_reference<Abstract>();
+    test_is_not_lvalue_reference<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_object_pointer.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -94,4 +95,5 @@ int main()
     test_is_not_member_object_pointer<bit_zero>();
     test_is_not_member_object_pointer<NotEmpty>();
     test_is_not_member_object_pointer<Abstract>();
+    test_is_not_member_object_pointer<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -95,4 +96,5 @@ int main()
     test_is_not_member_pointer<bit_zero>();
     test_is_not_member_pointer<NotEmpty>();
     test_is_not_member_pointer<Abstract>();
+    test_is_not_member_pointer<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_null_pointer.pass.cpp Thu Feb 25 14:15:47 2016
@@ -69,6 +69,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -92,4 +93,5 @@ int main()
     test_is_not_null_pointer<bit_zero>();
     test_is_not_null_pointer<NotEmpty>();
     test_is_not_null_pointer<Abstract>();
+    test_is_not_null_pointer<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_pointer.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -91,4 +92,5 @@ int main()
     test_is_not_pointer<bit_zero>();
     test_is_not_pointer<NotEmpty>();
     test_is_not_pointer<Abstract>();
+    test_is_not_pointer<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_rvalue_reference.pass.cpp Thu Feb 25 14:15:47 2016
@@ -69,6 +69,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -92,4 +93,5 @@ int main()
     test_is_not_rvalue_reference<bit_zero>();
     test_is_not_rvalue_reference<NotEmpty>();
     test_is_not_rvalue_reference<Abstract>();
+    test_is_not_rvalue_reference<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_union.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -90,4 +91,5 @@ int main()
     test_is_not_union<bit_zero>();
     test_is_not_union<NotEmpty>();
     test_is_not_union<Abstract>();
+    test_is_not_union<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/is_void.pass.cpp Thu Feb 25 14:15:47 2016
@@ -67,6 +67,7 @@ class Abstract
 };
 
 enum Enum {zero, one};
+struct incomplete_type;
 
 typedef void (*FunctionPtr)();
 
@@ -89,4 +90,5 @@ int main()
     test_is_not_void<Abstract>();
     test_is_not_void<Enum>();
     test_is_not_void<FunctionPtr>();
+    test_is_not_void<incomplete_type>();
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/lvalue_ref.pass.cpp Thu Feb 25 14:15:47 2016
@@ -34,8 +34,13 @@ void test_lvalue_ref()
     static_assert(!std::is_function<T>::value, "");
 }
 
+struct incomplete_type;
+
 int main()
 {
     test_lvalue_ref<int&>();
     test_lvalue_ref<const int&>();
+
+//  LWG#2581
+    static_assert(!std::is_lvalue_reference<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp Thu Feb 25 14:15:47 2016
@@ -48,6 +48,8 @@ class Class
 {
 };
 
+struct incomplete_type;
+
 int main()
 {
     test_member_function_pointer<void (Class::*)()>();
@@ -133,4 +135,7 @@ int main()
     test_member_function_pointer<void (Class::*)(int,...) const volatile &&>();
     test_member_function_pointer<void (Class::*)(int, char,...) const volatile &&>();
 #endif
+
+//  LWG#2581
+    static_assert(!std::is_member_function_pointer<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer_no_variadics.pass.cpp Thu Feb 25 14:15:47 2016
@@ -48,6 +48,8 @@ class Class
 {
 };
 
+struct incomplete_type;
+
 int main()
 {
     test_member_function_pointer<void (Class::*)()>();
@@ -73,4 +75,7 @@ int main()
     test_member_function_pointer<void (Class::*)(...) volatile>();
     test_member_function_pointer<void (Class::*)(int, ...) volatile>();
     test_member_function_pointer<void (Class::*)(int, char, ...) volatile>();
+
+//  LWG#2581
+    static_assert(!std::is_member_function_pointer<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/member_object_pointer.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // member_object_pointer
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_member_object_pointer_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -47,7 +48,12 @@ class Class
 {
 };
 
+struct incomplete_type;
+
 int main()
 {
     test_member_object_pointer<int Class::*>();
+
+//  LWG#2581
+    static_assert(!std::is_member_object_pointer<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/nullptr.pass.cpp Thu Feb 25 14:15:47 2016
@@ -14,8 +14,9 @@
 
 #include <type_traits>
 #include <cstddef>        // for std::nullptr_t
+#include "test_macros.h"
 
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
 template <class T>
 void test_nullptr_imp()
 {
@@ -44,9 +45,14 @@ void test_nullptr()
     test_nullptr_imp<const volatile T>();
 }
 
+struct incomplete_type;
+
 int main()
 {
     test_nullptr<std::nullptr_t>();
+
+//  LWG#2581
+    static_assert(!std::is_null_pointer<incomplete_type>::value, "");
 }
 #else
 int main() {}

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/pointer.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,14 @@
 // pointer
 
 #include <type_traits>
+#include "test_macros.h"
+
 
 template <class T>
 void test_pointer_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -43,10 +45,15 @@ void test_pointer()
     test_pointer_imp<const volatile T>();
 }
 
+struct incomplete_type;
+
 int main()
 {
     test_pointer<void*>();
     test_pointer<int*>();
     test_pointer<const int*>();
     test_pointer<void (*)(int)>();
+
+//  LWG#2581
+    static_assert(!std::is_pointer<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/rvalue_ref.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // rvalue_ref
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_rvalue_ref()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -34,10 +35,15 @@ void test_rvalue_ref()
     static_assert(!std::is_function<T>::value, "");
 }
 
+struct incomplete_type;
+
 int main()
 {
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test_rvalue_ref<int&&>();
     test_rvalue_ref<const int&&>();
+
+//  LWG#2581
+    static_assert(!std::is_rvalue_reference<incomplete_type>::value, "");
 #endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/union.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // union
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_union_imp()
 {
     static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -49,7 +50,12 @@ union Union
     double __;
 };
 
+struct incomplete_type;
+
 int main()
 {
     test_union<Union>();
+
+//  LWG#2581
+    static_assert(!std::is_union<incomplete_type>::value, "");
 }

Modified: libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp?rev=261925&r1=261924&r2=261925&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/meta/meta.unary/meta.unary.cat/void.pass.cpp Thu Feb 25 14:15:47 2016
@@ -12,12 +12,13 @@
 // void
 
 #include <type_traits>
+#include "test_macros.h"
 
 template <class T>
 void test_void_imp()
 {
     static_assert( std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
 #endif
     static_assert(!std::is_integral<T>::value, "");
@@ -43,7 +44,12 @@ void test_void()
     test_void_imp<const volatile T>();
 }
 
+struct incomplete_type;
+
 int main()
 {
     test_void<void>();
+
+//  LWG#2581
+    static_assert(!std::is_void<incomplete_type>::value, "");
 }




More information about the cfe-commits mailing list