public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r9-9363] libstdc++: Bodge tests that fail with COW strings
@ 2021-04-19 11:31 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-04-19 11:31 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:901858496939f4cd2b5e8f604576c376b25fa19c

commit r9-9363-g901858496939f4cd2b5e8f604576c376b25fa19c
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Apr 19 12:21:22 2021 +0100

    libstdc++: Bodge tests that fail with COW strings
    
    On the gcc-9 branch, the old std::basic_string does not use
    std::allocator_traits to access members of the allocator. That causes
    some tests to fail when using the minimal test allocator. Use a
    different test allocator instead.
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/27_io/filesystem/path/generic/94242.cc: Do not test
            with minimal allocator when using COW strings.
            * testsuite/experimental/filesystem/path/generic/generic_string.cc:
            Likewise.

Diff:
---
 libstdc++-v3/testsuite/27_io/filesystem/path/generic/94242.cc       | 6 ++++++
 .../experimental/filesystem/path/generic/generic_string.cc          | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/generic/94242.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/generic/94242.cc
index c917daed94e..6db35dcbed1 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/path/generic/94242.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/path/generic/94242.cc
@@ -24,7 +24,13 @@
 #include <testsuite_allocator.h>
 
 using std::filesystem::path;
+
+#if _GLIBCXX_USE_CXX11_ABI
 using __gnu_test::SimpleAllocator;
+#else
+// COW std::basic_string doesn't use std::allocator_traits properly.
+template<typename T> using SimpleAllocator = __gnu_test::uneq_allocator<T>;
+#endif
 
 void
 test01()
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc
index efaa452a586..8dc624ae17a 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/generic/generic_string.cc
@@ -35,7 +35,12 @@ test01()
   __gnu_test::compare_paths( path("//a//b").generic_u16string(), "//a/b" );
 }
 
+#if _GLIBCXX_USE_CXX11_ABI
 using __gnu_test::SimpleAllocator;
+#else
+// COW std::basic_string doesn't use std::allocator_traits properly.
+template<typename T> using SimpleAllocator = __gnu_test::uneq_allocator<T>;
+#endif
 
 void
 test02()


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-19 11:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 11:31 [gcc r9-9363] libstdc++: Bodge tests that fail with COW strings Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).