Improve tests for std::add_pointer
authorJonathan Wakely <jwakely@redhat.com>
Thu, 31 Oct 2019 14:07:11 +0000 (14:07 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 31 Oct 2019 14:07:11 +0000 (14:07 +0000)
The type trait depends on is_void so the tests should check those cases.

* testsuite/20_util/add_pointer/value.cc: Check void types.

From-SVN: r277672

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/add_pointer/value.cc

index d51a7d4714b3a26416960a2a99a1e2ded0b1805b..2a47289511704eb39cb1dee827d646b33e05bea4 100644 (file)
@@ -1,5 +1,7 @@
 2019-10-31  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/20_util/add_pointer/value.cc: Check void types.
+
        * include/bits/range_access.h (__sizable): Rename to __sentinel_size.
        Remove workaround for PR c++/92268 and remove redundant requirements
        that are already checked by sized_sentinel_for.
index acf9442851f428fb95a84f62f6681f6b205e4a5b..66d94783c11ea9010b96915a4e88ad7f4d10f2fa 100644 (file)
@@ -31,8 +31,14 @@ void test01()
   static_assert(is_same<add_pointer<const int>::type, const int*>::value, "");
   static_assert(is_same<add_pointer<int&>::type, int*>::value, "");
   static_assert(is_same<add_pointer<ClassType*>::type,
-               ClassType**>::value, "");
+                       ClassType**>::value, "");
   static_assert(is_same<add_pointer<ClassType>::type, ClassType*>::value, "");
+  static_assert(is_same<add_pointer<void>::type, void*>::value, "");
+  static_assert(is_same<add_pointer<const void>::type, const void*>::value, "");
+  static_assert(is_same<add_pointer<volatile void>::type,
+                       volatile void*>::value, "");
+  static_assert(is_same<add_pointer<const volatile void>::type,
+                       const volatile void*>::value, "");
 }
 
 void test02()