OSDN Git Service

2012-04-22 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Apr 2012 17:38:11 +0000 (17:38 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Apr 2012 17:38:11 +0000 (17:38 +0000)
PR libstdc++/53067
* include/bits/hashtable_policy.h: Change inheritances to public.
* testsuite/23_containers/unordered_map/requirements/53067.cc: New.
* testsuite/23_containers/unordered_set/requirements/53067.cc: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@186677 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/hashtable_policy.h
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53067.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_set/requirements/53067.cc [new file with mode: 0644]

index 005367a..3f0089f 100644 (file)
@@ -1,3 +1,10 @@
+2012-04-22  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/53067
+       * include/bits/hashtable_policy.h: Change inheritances to public.
+       * testsuite/23_containers/unordered_map/requirements/53067.cc: New.
+       * testsuite/23_containers/unordered_set/requirements/53067.cc: Likewise.
+
 2012-04-22  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        PR libstdc++/53027
index b585d23..ab1be6d 100644 (file)
@@ -533,7 +533,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // Specialization using EBO.
   template<int _Nm, typename _Tp>
-    struct _Hashtable_ebo_helper<_Nm, _Tp, true> : private _Tp
+    struct _Hashtable_ebo_helper<_Nm, _Tp, true>
+    // See PR53067.
+    : public _Tp
     {
       _Hashtable_ebo_helper() = default;
       _Hashtable_ebo_helper(const _Tp& __tp) : _Tp(__tp)
@@ -595,8 +597,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Key, typename _Value, typename _ExtractKey, 
           typename _H1, typename _H2, typename _Hash>
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, false>
-    : private _Hashtable_ebo_helper<0, _ExtractKey>,
-      private _Hashtable_ebo_helper<1, _Hash>
+    // See PR53067.
+    : public  _Hashtable_ebo_helper<0, _ExtractKey>,
+      public  _Hashtable_ebo_helper<1, _Hash>
     {
     private:
       typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey;
@@ -669,9 +672,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
           typename _H1, typename _H2>
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
                           _Default_ranged_hash, false>
-    : private _Hashtable_ebo_helper<0, _ExtractKey>,
-      private _Hashtable_ebo_helper<1, _H1>,
-      private _Hashtable_ebo_helper<2, _H2>
+    // See PR53067.
+    : public  _Hashtable_ebo_helper<0, _ExtractKey>,
+      public  _Hashtable_ebo_helper<1, _H1>,
+      public  _Hashtable_ebo_helper<2, _H2>
     {
     private:
       typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey;
@@ -748,9 +752,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
           typename _H1, typename _H2>
     struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
                           _Default_ranged_hash, true>
-    : private _Hashtable_ebo_helper<0, _ExtractKey>,
-      private _Hashtable_ebo_helper<1, _H1>,
-      private _Hashtable_ebo_helper<2, _H2>
+    // See PR53067.
+    : public  _Hashtable_ebo_helper<0, _ExtractKey>,
+      public  _Hashtable_ebo_helper<1, _H1>,
+      public  _Hashtable_ebo_helper<2, _H2>
     {
     private:
       typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey;
@@ -853,9 +858,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
           typename _H1, typename _H2, typename _Hash,
           bool __cache_hash_code>
   struct _Hashtable_base
+  // See PR53067.
   : public  _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash,
                            __cache_hash_code>,
-    private _Hashtable_ebo_helper<0, _Equal>
+    public _Hashtable_ebo_helper<0, _Equal>
   {
   private:
     typedef _Hashtable_ebo_helper<0, _Equal> _EboEqual;
@@ -906,7 +912,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
           typename _H1, typename _H2, typename _Hash>
     struct _Local_iterator_base<_Key, _Value, _ExtractKey,
                                _H1, _H2, _Hash, true>
-      : private _H2
+    // See PR53067.
+    : public _H2
     {
       _Local_iterator_base() = default;
       _Local_iterator_base(_Hash_node<_Value, true>* __p,
@@ -937,8 +944,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
           typename _H1, typename _H2, typename _Hash>
     struct _Local_iterator_base<_Key, _Value, _ExtractKey,
                                _H1, _H2, _Hash, false>
-      : private _Hash_code_base<_Key, _Value, _ExtractKey,
-                               _H1, _H2, _Hash, false>
+    // See PR53067.
+    : public _Hash_code_base<_Key, _Value, _ExtractKey,
+                            _H1, _H2, _Hash, false>
     {
       _Local_iterator_base() = default;
       _Local_iterator_base(_Hash_node<_Value, false>* __p,
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53067.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53067.cc
new file mode 100644 (file)
index 0000000..704f599
--- /dev/null
@@ -0,0 +1,28 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+
+// 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 Pred 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 <unordered_map>
+#include <functional>
+
+void f()
+{
+  std::unordered_map<int, int> Foo;
+  ref(Foo);
+}
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/53067.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/53067.cc
new file mode 100644 (file)
index 0000000..760f10c
--- /dev/null
@@ -0,0 +1,28 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+
+// 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 Pred 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 <unordered_set>
+#include <functional>
+
+void f()
+{
+  std::unordered_set<int> Foo;
+  ref(Foo);
+}