Patchwork New unordered containers debug check

login
register
mail settings
Submitter François Dumont
Date Oct. 16, 2012, 8 p.m.
Message ID <507DBCC9.3060808@gmail.com>
Download mbox | patch
Permalink /patch/191882/
State New
Headers show

Comments

François Dumont - Oct. 16, 2012, 8 p.m.
Attached patch applied.

2012-10-16  François Dumont  <fdumont@gcc.gnu.org>

     * include/debug/formatter.h (_Debug_msg_id): Add
     __msg_bucket_index_oob.
     * include/debug/macros.h (__glibcxx_check_bucket_index): New.
     * include/debug/unordered_set (unordered_set<>::begin(size_type)):
     Add check on bucket index.
     (unordered_set<>::begin(size_type) const): Likewise.
     (unordered_set<>::cbegin(size_type) const): Likewise.
     (unordered_set<>::end(size_type)): Likewise.
     (unordered_set<>::end(size_type) const): Likewise.
     (unordered_set<>::cend(size_type) const): Likewise.
     (unordered_set<>::bucket_size(size_type)): Likewise.
     (unordered_multiset<>::begin(size_type)): Likewise.
     (unordered_multiset<>::begin(size_type) const): Likewise.
     (unordered_multiset<>::cbegin(size_type) const): Likewise.
     (unordered_multiset<>::end(size_type)): Likewise.
     (unordered_multiset<>::end(size_type) const): Likewise.
     (unordered_multiset<>::cend(size_type) const): Likewise.
     (unordered_multiset<>::bucket_size(size_type)): Likewise.
     * include/debug/unordered_map (unordered_map<>::begin(size_type)):
     Likewise.
     (unordered_map<>::begin(size_type) const): Likewise.
     (unordered_map<>::cbegin(size_type) const): Likewise.
     (unordered_map<>::end(size_type)): Likewise.
     (unordered_map<>::end(size_type) const): Likewise.
     (unordered_map<>::cend(size_type) const): Likewise.
     (unordered_map<>::bucket_size(size_type)): Likewise.
     (unordered_multimap<>::begin(size_type)): Likewise.
     (unordered_multimap<>::begin(size_type) const): Likewise.
     (unordered_multimap<>::cbegin(size_type) const): Likewise.
     (unordered_multimap<>::end(size_type)): Likewise.
     (unordered_multimap<>::end(size_type) const): Likewise.
     (unordered_multimap<>::cend(size_type) const): Likewise.
     (unordered_multimap<>::bucket_size(size_type)): Likewise.
     * testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc:
     New.
     * testsuite/23_containers/unordered_map/debug/begin1_neg.cc: New.
     * testsuite/23_containers/unordered_map/debug/begin2_neg.cc: New.
     * testsuite/23_containers/unordered_map/debug/cbegin_neg.cc: New.
     * testsuite/23_containers/unordered_map/debug/end1_neg.cc: New.
     * testsuite/23_containers/unordered_map/debug/end2_neg.cc: New.
     * testsuite/23_containers/unordered_map/debug/cend_neg.cc: New.
     * testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc:
     New.
     * testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc: New.
     * testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc: New.
     * testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc: New.
     * testsuite/23_containers/unordered_multimap/debug/end1_neg.cc: New.
     * testsuite/23_containers/unordered_multimap/debug/end2_neg.cc: New.
     * testsuite/23_containers/unordered_multimap/debug/cend_neg.cc: New.
     * testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc:
     New.
     * testsuite/23_containers/unordered_set/debug/begin1_neg.cc: New.
     * testsuite/23_containers/unordered_set/debug/begin2_neg.cc: New.
     * testsuite/23_containers/unordered_set/debug/cbegin_neg.cc: New.
     * testsuite/23_containers/unordered_set/debug/end1_neg.cc: New.
     * testsuite/23_containers/unordered_set/debug/end2_neg.cc: New.
     * testsuite/23_containers/unordered_set/debug/cend_neg.cc: New.
     * testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc:
     New.
     * testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc: New.
     * testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc: New.
     * testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc: New.
     * testsuite/23_containers/unordered_multiset/debug/end1_neg.cc: New.
     * testsuite/23_containers/unordered_multiset/debug/end2_neg.cc: New.
     * testsuite/23_containers/unordered_multiset/debug/cend_neg.cc: New.

François

On 10/16/2012 12:26 AM, Paolo Carlini wrote:
> Hi,
>
> On 10/15/2012 11:11 PM, François Dumont wrote:
>> OK to commit ?
> Looks good. In the debug.cc change I see a stray comma, though.
>
> Thanks!
> Paolo.
>

Patch

Index: src/c++11/debug.cc
===================================================================
--- src/c++11/debug.cc	(revision 192510)
+++ src/c++11/debug.cc	(working copy)
@@ -178,7 +178,9 @@ 
     "attempt to compare local iterators from different unordered container"
     " buckets",
     "function requires a non-empty iterator range [%1.name;, %2.name;)",
-    "attempt to self move assign"
+    "attempt to self move assign",
+    "attempt to access container with out-of-bounds bucket index %2;,"
+    " container only holds %3; buckets"
   };
 
   void
Index: include/debug/unordered_map
===================================================================
--- include/debug/unordered_map	(revision 192510)
+++ include/debug/unordered_map	(working copy)
@@ -183,28 +183,53 @@ 
       // local versions
       local_iterator
       begin(size_type __b)
-      { return local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::begin(__b), __b, this);
+      }
 
       local_iterator
       end(size_type __b)
-      { return local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       begin(size_type __b) const
-      { return const_local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::begin(__b), __b, this);
+      }
 
       const_local_iterator
       end(size_type __b) const
-      { return const_local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       cbegin(size_type __b) const
-      { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cbegin(__b), __b, this);
+      }
 
       const_local_iterator
       cend(size_type __b) const
-      { return const_local_iterator(_Base::cend(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cend(__b), __b, this);
+      }
 
+      size_type
+      bucket_size(size_type __b) const
+      {
+	__glibcxx_check_bucket_index(__b);
+	return _Base::bucket_size(__b);
+      }
+
       template<typename... _Args>
 	std::pair<iterator, bool>
 	emplace(_Args&&... __args)
@@ -598,28 +623,53 @@ 
       // local versions
       local_iterator
       begin(size_type __b)
-      { return local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::begin(__b), __b, this);
+      }
 
       local_iterator
       end(size_type __b)
-      { return local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       begin(size_type __b) const
-      { return const_local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::begin(__b), __b, this);
+      }
 
       const_local_iterator
       end(size_type __b) const
-      { return const_local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       cbegin(size_type __b) const
-      { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cbegin(__b), __b, this);
+      }
 
       const_local_iterator
       cend(size_type __b) const
-      { return const_local_iterator(_Base::cend(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cend(__b), __b, this);
+      }
 
+      size_type
+      bucket_size(size_type __b) const
+      {
+	__glibcxx_check_bucket_index(__b);
+	return _Base::bucket_size(__b);
+      }
+
       template<typename... _Args>
 	iterator
 	emplace(_Args&&... __args)
Index: include/debug/formatter.h
===================================================================
--- include/debug/formatter.h	(revision 192510)
+++ include/debug/formatter.h	(working copy)
@@ -107,11 +107,13 @@ 
     __msg_insert_after_end,
     __msg_erase_after_bad,
     __msg_valid_range2,
-    // unordered sequence local iterators
+    // unordered container local iterators
     __msg_local_iter_compare_bad,
     __msg_non_empty_range,
     // self move assign
-    __msg_self_move_assign
+    __msg_self_move_assign,
+    // unordered container buckets
+    __msg_bucket_index_oob
   };
 
   class _Error_formatter
Index: include/debug/unordered_set
===================================================================
--- include/debug/unordered_set	(revision 192510)
+++ include/debug/unordered_set	(working copy)
@@ -183,28 +183,53 @@ 
       // local versions
       local_iterator
       begin(size_type __b)
-      { return local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::begin(__b), __b, this);
+      }
 
       local_iterator
       end(size_type __b)
-      { return local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       begin(size_type __b) const
-      { return const_local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::begin(__b), __b, this);
+      }
 
       const_local_iterator
       end(size_type __b) const
-      { return const_local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       cbegin(size_type __b) const
-      { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cbegin(__b), __b, this);
+      }
 
       const_local_iterator
       cend(size_type __b) const
-      { return const_local_iterator(_Base::cend(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cend(__b), __b, this);
+      }
 
+      size_type
+      bucket_size(size_type __b) const
+      {
+	__glibcxx_check_bucket_index(__b);
+	return _Base::bucket_size(__b);
+      }
+
       template<typename... _Args>
 	std::pair<iterator, bool>
 	emplace(_Args&&... __args)
@@ -593,28 +618,53 @@ 
       // local versions
       local_iterator
       begin(size_type __b)
-      { return local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::begin(__b), __b, this);
+      }
 
       local_iterator
       end(size_type __b)
-      { return local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       begin(size_type __b) const
-      { return const_local_iterator(_Base::begin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::begin(__b), __b, this);
+      }
 
       const_local_iterator
       end(size_type __b) const
-      { return const_local_iterator(_Base::end(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::end(__b), __b, this);
+      }
 
       const_local_iterator
       cbegin(size_type __b) const
-      { return const_local_iterator(_Base::cbegin(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cbegin(__b), __b, this);
+      }
 
       const_local_iterator
       cend(size_type __b) const
-      { return const_local_iterator(_Base::cend(__b), __b, this); }
+      {
+	__glibcxx_check_bucket_index(__b);
+	return const_local_iterator(_Base::cend(__b), __b, this);
+      }
 
+      size_type
+      bucket_size(size_type __b) const
+      {
+	__glibcxx_check_bucket_index(__b);
+	return _Base::bucket_size(__b);
+      }
+
       template<typename... _Args>
 	iterator
 	emplace(_Args&&... __args)
Index: include/debug/macros.h
===================================================================
--- include/debug/macros.h	(revision 192510)
+++ include/debug/macros.h	(working copy)
@@ -202,11 +202,19 @@ 
 // Verify that the subscript _N is less than the container's size.
 #define __glibcxx_check_subscript(_N)					\
 _GLIBCXX_DEBUG_VERIFY(_N < this->size(),				\
-		      _M_message(__gnu_debug::__msg_subscript_oob)      \
+		      _M_message(__gnu_debug::__msg_subscript_oob)	\
                       ._M_sequence(*this, "this")			\
 		      ._M_integer(_N, #_N)				\
 		      ._M_integer(this->size(), "size"))
 
+// Verify that the bucket _N is less than the container's buckets count.
+#define __glibcxx_check_bucket_index(_N)				\
+_GLIBCXX_DEBUG_VERIFY(_N < this->bucket_count(),			\
+		      _M_message(__gnu_debug::__msg_bucket_index_oob)	\
+                      ._M_sequence(*this, "this")			\
+		      ._M_integer(_N, #_N)				\
+		      ._M_integer(this->bucket_count(), "size"))
+
 // Verify that the container is nonempty
 #define __glibcxx_check_nonempty()					\
 _GLIBCXX_DEBUG_VERIFY(! this->empty(),					\
Index: testsuite/23_containers/unordered_map/debug/end1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_map/debug/end1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/debug/end1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.end(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_map/debug/cbegin_neg.cc
===================================================================
--- testsuite/23_containers/unordered_map/debug/cbegin_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/debug/cbegin_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.cbegin(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_map/debug/end2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_map/debug/end2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/debug/end2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  const std::unordered_map<int, int>& cum = um;
+  cum.end(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_map/debug/begin1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_map/debug/begin1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/debug/begin1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.begin(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_map/debug/begin2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_map/debug/begin2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/debug/begin2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  const std::unordered_map<int, int>& cum = um;
+  cum.begin(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc
===================================================================
--- testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/debug/bucket_size_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.bucket_size(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_map/debug/cend_neg.cc
===================================================================
--- testsuite/23_containers/unordered_map/debug/cend_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_map/debug/cend_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.cend(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/debug/begin1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_multimap<int, int> um;
+  um.begin(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/debug/begin2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  const std::unordered_map<int, int>& cum = um;
+  cum.begin(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/debug/bucket_size_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.bucket_size(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multimap/debug/cend_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/debug/cend_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/debug/cend_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.cend(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multimap/debug/end1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/debug/end1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/debug/end1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.end(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/debug/cbegin_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  um.cbegin(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multimap/debug/end2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multimap/debug/end2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multimap/debug/end2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_map>
+
+void test01()
+{
+  std::unordered_map<int, int> um;
+  const std::unordered_map<int, int>& cum = um;
+  cum.end(um.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multiset/debug/end2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/debug/end2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/debug/end2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_multiset<int> us;
+  const std::unordered_multiset<int>& cus = us;
+  cus.end(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/debug/begin1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_multiset<int> us;
+  us.begin(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/debug/begin2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_multiset<int> us;
+  const std::unordered_multiset<int>& cus = us;
+  cus.begin(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/debug/bucket_size_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_multiset<int> us;
+  us.bucket_size(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multiset/debug/cend_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/debug/cend_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/debug/cend_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_multiset<int> us;
+  us.cend(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/debug/cbegin_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_multiset<int> us;
+  us.cbegin(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_multiset/debug/end1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_multiset/debug/end1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_multiset/debug/end1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_multiset<int> us;
+  us.end(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_set/debug/end1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_set/debug/end1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/debug/end1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_set<int> us;
+  us.end(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_set/debug/cbegin_neg.cc
===================================================================
--- testsuite/23_containers/unordered_set/debug/cbegin_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/debug/cbegin_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_set<int> us;
+  us.cbegin(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_set/debug/end2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_set/debug/end2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/debug/end2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_set<int> us;
+  const std::unordered_set<int>& cus = us;
+  cus.end(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_set/debug/begin1_neg.cc
===================================================================
--- testsuite/23_containers/unordered_set/debug/begin1_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/debug/begin1_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_set<int> us;
+  us.begin(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_set/debug/begin2_neg.cc
===================================================================
--- testsuite/23_containers/unordered_set/debug/begin2_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/debug/begin2_neg.cc	(revision 0)
@@ -0,0 +1,35 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_set<int> us;
+  const std::unordered_set<int>& cus = us;
+  cus.begin(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc
===================================================================
--- testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/debug/bucket_size_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_set<int> us;
+  us.bucket_size(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
Index: testsuite/23_containers/unordered_set/debug/cend_neg.cc
===================================================================
--- testsuite/23_containers/unordered_set/debug/cend_neg.cc	(revision 0)
+++ testsuite/23_containers/unordered_set/debug/cend_neg.cc	(revision 0)
@@ -0,0 +1,34 @@ 
+// Copyright (C) 2012 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-require-debug-mode "" }
+// { dg-options "-std=c++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <unordered_set>
+
+void test01()
+{
+  std::unordered_set<int> us;
+  us.cend(us.bucket_count());
+}
+
+int main()
+{
+  test01();
+  return 0;
+}