aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-03-21 12:32:14 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2018-03-21 12:32:14 +0000
commit5a0729f5a4c323aaee60fa93a1b0823c74e32f4e (patch)
treefa077ba47c8842c19e447058b50cbc8cdb219f7f
parentc75c35e0f52a4f4feca1058a67bb78c660605e24 (diff)
downloadgcc-5a0729f5a4c323aaee60fa93a1b0823c74e32f4e.zip
gcc-5a0729f5a4c323aaee60fa93a1b0823c74e32f4e.tar.gz
gcc-5a0729f5a4c323aaee60fa93a1b0823c74e32f4e.tar.bz2
Fix some libstdc++ testsuite failures
* testsuite/20_util/function_objects/comparisons_pointer.cc: Use VERIFY instead of assert. * testsuite/20_util/hash/84998.cc: New test. * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: New copy of test adjusted for Debug Mode. * testsuite/23_containers/vector/cons/destructible_neg.cc: Do not run test in Debug Mode. From-SVN: r258714
-rw-r--r--libstdc++-v3/ChangeLog10
-rw-r--r--libstdc++-v3/testsuite/20_util/function_objects/comparisons_pointer.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/hash/84998.cc40
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc48
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/cons/destructible_neg.cc1
5 files changed, 100 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 7ac98fb..4bdda7e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,13 @@
+2018-03-21 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/20_util/function_objects/comparisons_pointer.cc: Use
+ VERIFY instead of assert.
+ * testsuite/20_util/hash/84998.cc: New test.
+ * testsuite/23_containers/vector/cons/destructible_debug_neg.cc: New
+ copy of test adjusted for Debug Mode.
+ * testsuite/23_containers/vector/cons/destructible_neg.cc: Do not run
+ test in Debug Mode.
+
2018-03-20 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/84998
diff --git a/libstdc++-v3/testsuite/20_util/function_objects/comparisons_pointer.cc b/libstdc++-v3/testsuite/20_util/function_objects/comparisons_pointer.cc
index aad0bc3..474190c 100644
--- a/libstdc++-v3/testsuite/20_util/function_objects/comparisons_pointer.cc
+++ b/libstdc++-v3/testsuite/20_util/function_objects/comparisons_pointer.cc
@@ -174,7 +174,7 @@ test05()
int n = 0;
while (ss >> n)
sum += n;
- assert( sum == 1 );
+ VERIFY( sum == 1 );
#if __cplusplus >= 201402L
static_assert( lt(y, y+1), "constexpr less<const X*>" );
diff --git a/libstdc++-v3/testsuite/20_util/hash/84998.cc b/libstdc++-v3/testsuite/20_util/hash/84998.cc
new file mode 100644
index 0000000..72bd203
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/hash/84998.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2018 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 "-D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++11 } }
+
+// PR libstdc++/84998
+
+#include <bitset>
+#include <vector>
+
+std::size_t
+test01()
+{
+ std::bitset<1> b;
+ std::hash<std::bitset<1>> h;
+ return h(b);
+}
+
+std::size_t
+test02()
+{
+ std::vector<bool> b;
+ std::hash<std::vector<bool>> h;
+ return h(b);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc
new file mode 100644
index 0000000..5127f51
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc
@@ -0,0 +1,48 @@
+// Copyright (C) 2017-2018 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 "-D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++11 } }
+
+#include <vector>
+
+// PR libstdc++/80553
+
+struct DeletedDtor {
+ ~DeletedDtor() = delete;
+};
+
+class PrivateDtor {
+ ~PrivateDtor() { }
+};
+
+void
+test01()
+{
+ std::vector<DeletedDtor> v;
+}
+
+void
+test02()
+{
+ std::vector<PrivateDtor> v;
+}
+
+// { dg-error "value type is destructible" "" { target *-*-* } 0 }
+
+// In Debug Mode the "required from here" errors come from <debug/vector>
+// { dg-error "required from here" "" { target *-*-* } 155 }
diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_neg.cc
index fc5e319..06fd073 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_neg.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_neg.cc
@@ -16,6 +16,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-do compile { target c++11 } }
+// { dg-require-normal-mode "" }
#include <vector>