Add __gnu_test::NullablePointer utility to testsuite
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 May 2019 11:17:23 +0000 (12:17 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 14 May 2019 11:17:23 +0000 (12:17 +0100)
commit066f9ea27960c21b73be820f2bcd62d0c2f3d6b8
tree9f674a88bead34cd63d66f7cec0486bfe3f6a4ed
parente25f488d603a6bd7570c1ffdfd9572e4b8a645de
Add __gnu_test::NullablePointer utility to testsuite

* testsuite/20_util/allocator_traits/members/allocate_hint_nonpod.cc:
Use operator-> to access raw pointer member.
* testsuite/23_containers/vector/59829.cc: Likewise.
* testsuite/23_containers/vector/bool/80893.cc: Likewise.
* testsuite/libstdc++-prettyprinters/cxx11.cc: Use NullablePointer.
* testsuite/util/testsuite_allocator.h (NullablePointer): New utility
for tests.
(PointerBase, PointerBase_void): Derive from NullablePointer and use
its constructors and equality operators. Change converting
constructors to use operator-> to access private member of the other
pointer type.
(PointerBase_void::operator->()): Add, for access to private member.
(operator-(PointerBase, PointerBase)): Change to hidden friend.
(operator==(PointerBase, PointerBase)): Remove.
(operator!=(PointerBase, PointerBase)): Remove.

From-SVN: r271160
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/allocator_traits/members/allocate_hint_nonpod.cc
libstdc++-v3/testsuite/23_containers/vector/59829.cc
libstdc++-v3/testsuite/23_containers/vector/bool/80893.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
libstdc++-v3/testsuite/util/testsuite_allocator.h