Commit b9ff4d7c by Jonathan Wakely Committed by Jonathan Wakely

Improve tests for std::add_pointer

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
parent b3ffa117
2019-10-31 Jonathan Wakely <jwakely@redhat.com> 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. * include/bits/range_access.h (__sizable): Rename to __sentinel_size.
Remove workaround for PR c++/92268 and remove redundant requirements Remove workaround for PR c++/92268 and remove redundant requirements
that are already checked by sized_sentinel_for. that are already checked by sized_sentinel_for.
......
...@@ -31,8 +31,14 @@ void test01() ...@@ -31,8 +31,14 @@ void test01()
static_assert(is_same<add_pointer<const int>::type, const int*>::value, ""); 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<int&>::type, int*>::value, "");
static_assert(is_same<add_pointer<ClassType*>::type, 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<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() void test02()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment