container nonstd pointer support & testsuite
Bob Walters
bob.s.walters@gmail.com
Tue Aug 12 20:18:00 GMT 2008
Sending up the testsuite changes for the non-std pointer support,
along with associated code. This set of patches is ready for
evaluation/commit. Hereafter, I'll just be looking to do the same to
the other container types, until all are compliant.
The change to the testsuite is minimal - I've added a
'check-nonstd-pointer' target. When run, it creates a patched version
of std::allocator in the build/.../testsuite/nonstd_pointer directory
which uses a non-standard pointer type (_gcc_cxx::__pointer<>), and
then runs the standard 'check-DEJAGNU' target (i.e. all tests) using
that allocator. Consequently, all containers which support non-std
pointers get tested in that mode. For those that don't support
non-std pointers, it guarantees that they ignore the pointer typedef
in the allocator correctly.
Attached Files (14):
(new) ext/cast.h - provides the _gcc_cxx::__cast_to' struct to allow
conversion operator overloading by custom pointer types.
(new) ext/pointer.h - a _gcc_cxx::__pointer<> template to serve 2
purposes. 1) demo a pointer that works, 2) provide a reusable pointer
shell. __pointer takes a simpler pointer_impl template parameter,
making it easy to write a custom pointer without having to reinvent
all the appropriate supporting code (pointer arithmetic, comparison
operations, implicit casts, etc.) encapsulated in __pointer. 2 sample
impls are provided.
testsuite_Makefile.am.patch - patch to the testsuite/Makefile.am,
adding 'check-nonstd-pointer' target.
testsuite_Makefile.in.patch - patch to the testsuite/Makefile.in (both
were in svn, so I'm providing both)
libstdc++-v3/scripts/nonstd_allocator.patch - patch file for
check-nonstd-pointer test, produces non standard allocator
map_1_neg.cc.path - patch to
testsuite/23_containers/map/operators/1_neg.cc - minor change to
realign error message line numbers.
set_1_neg.cc.path - patch to
testsuite/23_containers/set/operators/1_neg.cc - ditto.
include_Makefile.am.patch - patch to include/Makefile.am to add
bits/stl_tree.tcc, ext/cast.h ext/pointer.h
include_Makefile.in.patch - patch to include/Makefile.in to add
bits/stl_tree.tcc, ext/cast.h ext/pointer.h
bits/stl_tree.h.patch - additional changes to use __cast_to<>
consistently everywhere where a custom pointer might want to overload
the standard pointer cast operators (static_cast<>, etc.) This
supersedes the last version of this patch that I posted.
bits/stl_tree.tcc - additional changes from last posted version of
this new file to fix some problems revealed by the testsuite. Let me
know if you want a diff. This supersedes the last version of this
file that I posted.
bits/stl_vector.h.patch - vector support for non-std pointer.
bits/basic_string.h.patch - basic_string support for non-std pointer.
bits/stl_deque.h - small patch to allow deque to work if the
allocator::pointer is a non-standard pointer type. Current code does
not compile if allocator::pointer is not _Tp*, so I just made the
standard pointer assumption hard-coded for now ..., so the test suite
will work.
Status of Testing:
The only difference that I am seeing with the testsuite right now
between 'make check' prior to this patch, and 'make
check-nonstd-pointer' after this patch is 1 additional failure. (3/4
total on my system). The additional failure is in
21_strings/basic_string/init-list.cc; getting some sort of strange
link error associated with basic_string. I will look into this. I
suspect it is something related to c++0X and may be in flux.
Please let me know if you need me to do anything further in regard to
this code. I'm stopping here until this is ironed out, and will then
proceed with the other STL and ext containers.
- Bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cast.h
Type: application/octet-stream
Size: 2833 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: basic_string.h.patch
Type: application/octet-stream
Size: 411 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_Makefile.am.patch
Type: application/octet-stream
Size: 891 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_Makefile.in.patch
Type: application/octet-stream
Size: 891 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: map_1_neg.cc.patch
Type: application/octet-stream
Size: 456 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nonstd_allocator.patch
Type: application/octet-stream
Size: 1684 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pointer.h
Type: application/octet-stream
Size: 10508 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: set_1_neg.cc.patch
Type: application/octet-stream
Size: 455 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0007.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stl_deque.h.patch
Type: application/octet-stream
Size: 2221 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0008.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stl_tree.h.patch
Type: application/octet-stream
Size: 17885 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0009.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stl_tree.tcc
Type: application/octet-stream
Size: 13202 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0010.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stl_tree.tcc
Type: application/octet-stream
Size: 13202 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0011.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stl_vector.h.patch
Type: application/octet-stream
Size: 569 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0012.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testsuite_Makefile.am.patch
Type: application/octet-stream
Size: 1194 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0013.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testsuite_Makefile.in.patch
Type: application/octet-stream
Size: 1177 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080812/a133505e/attachment-0014.obj>
More information about the Libstdc++
mailing list