public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r9-9363] libstdc++: Bodge tests that fail with COW strings Date: Mon, 19 Apr 2021 11:31:27 +0000 (GMT) [thread overview] Message-ID: <20210419113127.B9190386FC19@sourceware.org> (raw) 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()
reply other threads:[~2021-04-19 11:31 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210419113127.B9190386FC19@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).