aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libstdc++-v3/testsuite/23_containers
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/libstdc++-v3/testsuite/23_containers')
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc2
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc2
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/set/cons/61023.cc56
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/61143.cc38
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap.cc65
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc2
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc2
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc2
-rw-r--r--gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc2
11 files changed, 167 insertions, 8 deletions
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
index 4de8f2d0f..b91c8f271 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1764 }
+// { dg-error "no matching" "" { target *-*-* } 1810 }
#include <deque>
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
index 41f290561..5bc384780 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1697 }
+// { dg-error "no matching" "" { target *-*-* } 1743 }
#include <deque>
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
index f77b12678..27d34e015 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1697 }
+// { dg-error "no matching" "" { target *-*-* } 1743 }
#include <deque>
#include <utility>
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
index e7d5b1ee6..72fca0968 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1848 }
+// { dg-error "no matching" "" { target *-*-* } 1894 }
#include <deque>
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/set/cons/61023.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/set/cons/61023.cc
new file mode 100644
index 000000000..087b9cc18
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/set/cons/61023.cc
@@ -0,0 +1,56 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <set>
+#include <stdexcept>
+
+struct Comparator
+{
+ Comparator() : valid(false) { }
+ explicit Comparator(bool) : valid(true) { }
+
+ bool operator()(int i, int j) const
+ {
+ if (!valid)
+ throw std::logic_error("Comparator is invalid");
+ return i < j;
+ }
+
+private:
+ bool valid;
+};
+
+int main()
+{
+ using test_type = std::set<int, Comparator>;
+
+ Comparator cmp{true};
+
+ test_type good{cmp};
+
+ test_type s1;
+ s1 = good; // copy-assign
+ s1.insert(1);
+ s1.insert(2);
+
+ test_type s2;
+ s2 = std::move(good); // move-assign
+ s2.insert(1);
+ s2.insert(2);
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/61143.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/61143.cc
new file mode 100644
index 000000000..b9464254f
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/61143.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// libstdc++/61143
+
+#include <unordered_set>
+
+void test01()
+{
+ std::unordered_set<int> us1, us2;
+ us1.insert(1);
+
+ us2 = std::move(us1);
+
+ us1.insert(1);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap.cc
new file mode 100644
index 000000000..d03fd1dc3
--- /dev/null
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/unordered_set/modifiers/swap.cc
@@ -0,0 +1,65 @@
+// Copyright (C) 2014 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+
+#include <unordered_set>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::unordered_set<int> us1 { 0, 1 };
+ {
+ std::unordered_set<int> us2(std::move(us1));
+
+ us1.swap(us2);
+
+ VERIFY( us1.find(0) != us1.end() );
+
+ us1.insert(2);
+
+ VERIFY( us1.size() == 3 );
+
+ us2.swap(us1);
+
+ VERIFY( us2.size() == 3 );
+ VERIFY( us2.find(2) != us2.end() );
+
+ us1 = { 3, 4, 5 };
+
+ VERIFY( us1.size() == 3 );
+ VERIFY( us1.bucket_count() >= 3 );
+
+ std::unordered_set<int> us3(std::move(us1));
+ us3 = std::move(us2);
+
+ us1.swap(us2);
+
+ VERIFY( us1.empty() );
+ VERIFY( us2.empty() );
+ }
+
+ us1 = { 0, 1 };
+ VERIFY( us1.size() == 2 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
index 655c7e8ad..369881ddb 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1326 }
+// { dg-error "no matching" "" { target *-*-* } 1486 }
#include <vector>
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
index d938aa21b..fb7a6d4c0 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1252 }
+// { dg-error "no matching" "" { target *-*-* } 1412 }
#include <vector>
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
index f88828562..1ed760f52 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1252 }
+// { dg-error "no matching" "" { target *-*-* } 1412 }
#include <vector>
#include <utility>
diff --git a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
index 316249b01..2fa2002d1 100644
--- a/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
+++ b/gcc-4.9/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
@@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1367 }
+// { dg-error "no matching" "" { target *-*-* } 1527 }
#include <vector>