Commit 970aa0b9 by Paolo Carlini Committed by Paolo Carlini

re PR c++/53067 (c++0x GCC 4.7.0 Regression std::ref with unordered sets)

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.

From-SVN: r186676
parent 96b3ee1c
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> 2012-04-22 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/ext/alloc_traits.h (__alloc_traits::difference_type): * include/ext/alloc_traits.h (__alloc_traits::difference_type):
......
...@@ -882,7 +882,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -882,7 +882,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// Specialization using EBO. /// Specialization using EBO.
template<int _Nm, typename _Tp> 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() = default;
...@@ -949,8 +951,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -949,8 +951,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Key, typename _Value, typename _ExtractKey, template<typename _Key, typename _Value, typename _ExtractKey,
typename _H1, typename _H2, typename _Hash> typename _H1, typename _H2, typename _Hash>
struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, false> struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, false>
: private _Hashtable_ebo_helper<0, _ExtractKey>, // See PR53067.
private _Hashtable_ebo_helper<1, _Hash> : public _Hashtable_ebo_helper<0, _ExtractKey>,
public _Hashtable_ebo_helper<1, _Hash>
{ {
private: private:
typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey; typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey;
...@@ -1025,9 +1028,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1025,9 +1028,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _H1, typename _H2> typename _H1, typename _H2>
struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
_Default_ranged_hash, false> _Default_ranged_hash, false>
: private _Hashtable_ebo_helper<0, _ExtractKey>, // See PR53067.
private _Hashtable_ebo_helper<1, _H1>, : public _Hashtable_ebo_helper<0, _ExtractKey>,
private _Hashtable_ebo_helper<2, _H2> public _Hashtable_ebo_helper<1, _H1>,
public _Hashtable_ebo_helper<2, _H2>
{ {
private: private:
typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey; typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey;
...@@ -1108,9 +1112,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1108,9 +1112,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _H1, typename _H2> typename _H1, typename _H2>
struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2,
_Default_ranged_hash, true> _Default_ranged_hash, true>
: private _Hashtable_ebo_helper<0, _ExtractKey>, // See PR53067.
private _Hashtable_ebo_helper<1, _H1>, : public _Hashtable_ebo_helper<0, _ExtractKey>,
private _Hashtable_ebo_helper<2, _H2> public _Hashtable_ebo_helper<1, _H1>,
public _Hashtable_ebo_helper<2, _H2>
{ {
private: private:
typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey; typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey;
...@@ -1229,7 +1234,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1229,7 +1234,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _H1, typename _H2, typename _Hash> typename _H1, typename _H2, typename _Hash>
struct _Local_iterator_base<_Key, _Value, _ExtractKey, struct _Local_iterator_base<_Key, _Value, _ExtractKey,
_H1, _H2, _Hash, true> _H1, _H2, _Hash, true>
: private _H2 // See PR53067.
: public _H2
{ {
_Local_iterator_base() = default; _Local_iterator_base() = default;
_Local_iterator_base(_Hash_node<_Value, true>* __p, _Local_iterator_base(_Hash_node<_Value, true>* __p,
...@@ -1261,8 +1267,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1261,8 +1267,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _H1, typename _H2, typename _Hash> typename _H1, typename _H2, typename _Hash>
struct _Local_iterator_base<_Key, _Value, _ExtractKey, struct _Local_iterator_base<_Key, _Value, _ExtractKey,
_H1, _H2, _Hash, false> _H1, _H2, _Hash, false>
: private _Hash_code_base<_Key, _Value, _ExtractKey, // See PR53067.
_H1, _H2, _Hash, false> : public _Hash_code_base<_Key, _Value, _ExtractKey,
_H1, _H2, _Hash, false>
{ {
_Local_iterator_base() = default; _Local_iterator_base() = default;
_Local_iterator_base(_Hash_node<_Value, false>* __p, _Local_iterator_base(_Hash_node<_Value, false>* __p,
...@@ -1421,9 +1428,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1421,9 +1428,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _ExtractKey, typename _Equal, typename _ExtractKey, typename _Equal,
typename _H1, typename _H2, typename _Hash, typename _Traits> typename _H1, typename _H2, typename _Hash, typename _Traits>
struct _Hashtable_base struct _Hashtable_base
// See PR53067.
: public _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, : public _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash,
_Traits::__hash_cached::value>, _Traits::__hash_cached::value>,
private _Hashtable_ebo_helper<0, _Equal> public _Hashtable_ebo_helper<0, _Equal>
{ {
public: public:
typedef _Key key_type; typedef _Key key_type;
......
// { 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);
}
// { 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);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment