This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libstdc++/89130 and libstdc++/89090 fixes for vector relocation


On 05/02/19 14:45 +0000, Jonathan Wakely wrote:
This fixes two PRs, one trivial (don't use C++17 features in C++11
mode) and one more serious (don't require MoveInsertable when we
should only need CopyInsertable).

It would be nice to rely on if-constexpr in C++11 mode, but it causes
clang warnings, complicates testcase bisection/reduction, and causes
users to file bogus bug reports. So let's just avoid it.

Oh, and the test change can be reverted now that types with deleted
moves work again.

Tested x86_64-linux, committed to trunk.


commit 3cd6139661801ab6bd88558e336a8ba12d1ed640
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Feb 5 14:50:58 2019 +0000

    Restore previous behaviour of test
    
    Go back to using CopyConsOnlyType as before r265485, because it works
    again now. Add test using DelAnyAssign for completeness and additional
    coverage.
    
            * testsuite/23_containers/vector/modifiers/push_back/49836.cc: Restore
            use of CopyConsOnlyType, but also test DelAnyAssign for completeness.

diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc
index 1a7d8729718..3e59781e7cc 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc
@@ -24,11 +24,12 @@
 // libstdc++/49836
 void test01()
 {
-  using __gnu_test::assign::DelAnyAssign;
+  using __gnu_test::CopyConsOnlyType;
   using __gnu_test::MoveConsOnlyType;
+  using __gnu_test::assign::DelAnyAssign;
 
-  std::vector<DelAnyAssign> v1;
-  DelAnyAssign t1;
+  std::vector<CopyConsOnlyType> v1;
+  CopyConsOnlyType t1(1);
   v1.push_back(t1);
   v1.push_back(t1);
   v1.push_back(t1);
@@ -40,6 +41,14 @@ void test01()
   v2.push_back(std::move(t2));
   v2.push_back(std::move(t2));
   VERIFY( v2.size() == 3 );
+
+  std::vector<DelAnyAssign> v3;
+  DelAnyAssign t3;
+  v3.push_back(t3);
+  v3.push_back(t3);
+  v3.push_back(t3);
+  VERIFY( v3.size() == 3 );
+
 }
 
 int main()

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]