Blame SOURCES/0001-basic_string-reserve-n-semantics-are-not-available-i.patch

e60d6e
From 8a7f364afd86a4c4c2c747ae9cb4216fe992acc8 Mon Sep 17 00:00:00 2001
e60d6e
From: David Malcolm <dmalcolm@redhat.com>
e60d6e
Date: Wed, 25 Aug 2021 12:36:42 -0400
e60d6e
Subject: [PATCH 01/17] basic_string::reserve(n) semantics are not available in
e60d6e
 DTS
e60d6e
e60d6e
Various tests were added upstream 2020-08-06 as part of:
e60d6e
  "libstdc++: Implement P0966 std::string::reserve should not shrink"
e60d6e
  https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=140cf935cd118f7208b7c3826a8b9d50936242f0
e60d6e
e60d6e
std::string and std::wstring are instantiated in the system libstdc++.so
e60d6e
via explicit instantiation definitions, so the new basic_string::reserve(n)
e60d6e
semantics are not available in DTS.
e60d6e
e60d6e
Update/disable the pertinent parts of the tests to reflect the behavior
e60d6e
when run against the system libstdc++.so.
e60d6e
---
e60d6e
 .../testsuite/21_strings/basic_string/capacity/char/1.cc    | 6 ------
e60d6e
 .../21_strings/basic_string/capacity/char/18654.cc          | 2 +-
e60d6e
 .../testsuite/21_strings/basic_string/capacity/wchar_t/1.cc | 6 ------
e60d6e
 .../21_strings/basic_string/capacity/wchar_t/18654.cc       | 2 +-
e60d6e
 4 files changed, 2 insertions(+), 14 deletions(-)
e60d6e
e60d6e
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
e60d6e
index eea69771f..64187718d 100644
e60d6e
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
e60d6e
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
e60d6e
@@ -41,12 +41,6 @@ void test01()
e60d6e
   sz01 = str01.capacity();
e60d6e
   VERIFY( sz01 < sz02 );
e60d6e
 
e60d6e
-  // P0966: reserve should not shrink
e60d6e
-  str01.reserve(100);
e60d6e
-  sz01 = str01.capacity();
e60d6e
-  str01.reserve(sz01 - 1);
e60d6e
-  VERIFY( str01.capacity() == sz01 );
e60d6e
-
e60d6e
   sz01 = str01.size() + 5;
e60d6e
   str01.resize(sz01);
e60d6e
   sz02 = str01.size();
e60d6e
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
e60d6e
index 02ce78ea6..3a7352123 100644
e60d6e
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
e60d6e
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc
e60d6e
@@ -51,7 +51,7 @@ void test01()
e60d6e
       VERIFY( cap >= 3 * i );
e60d6e
 
e60d6e
       str.reserve(2 * i);
e60d6e
-      VERIFY( str.capacity() == cap );
e60d6e
+      VERIFY( str.capacity() == 2 * i );
e60d6e
 
e60d6e
 #if __cplusplus <= 201703L
e60d6e
       str.reserve();
e60d6e
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
e60d6e
index f01a27e8c..70915a94d 100644
e60d6e
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
e60d6e
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
e60d6e
@@ -41,12 +41,6 @@ void test01()
e60d6e
   sz01 = str01.capacity();
e60d6e
   VERIFY( sz01 < sz02 );
e60d6e
 
e60d6e
-  // P0966: reserve should not shrink
e60d6e
-  str01.reserve(100);
e60d6e
-  sz01 = str01.capacity();
e60d6e
-  str01.reserve(sz01 - 1);
e60d6e
-  VERIFY( str01.capacity() == sz01 );
e60d6e
-
e60d6e
   sz01 = str01.size() + 5;
e60d6e
   str01.resize(sz01);
e60d6e
   sz02 = str01.size();
e60d6e
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
e60d6e
index 267fd198b..c9711a294 100644
e60d6e
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
e60d6e
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc
e60d6e
@@ -51,7 +51,7 @@ void test01()
e60d6e
       VERIFY( cap >= 3 * i );
e60d6e
 
e60d6e
       str.reserve(2 * i);
e60d6e
-      VERIFY( str.capacity() == cap );
e60d6e
+      VERIFY( str.capacity() == 2 * i );
e60d6e
 
e60d6e
 #if __cplusplus <= 201703L
e60d6e
       str.reserve();
e60d6e
-- 
e60d6e
2.31.1