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

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