diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-05-15 10:00:19 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-05-15 10:00:19 +0000 |
commit | 5ac4e73a1dc07f019feee9eceb39f0937ba25b8c (patch) | |
tree | 9983ba44c7753e2b84264a4b942386269047c4cb /libstdc++-v3/testsuite | |
parent | 23adb371935682f1883c9afbff4086d73c8deb97 (diff) | |
download | gcc-5ac4e73a1dc07f019feee9eceb39f0937ba25b8c.zip gcc-5ac4e73a1dc07f019feee9eceb39f0937ba25b8c.tar.gz gcc-5ac4e73a1dc07f019feee9eceb39f0937ba25b8c.tar.bz2 |
re PR libstdc++/53339 (unordered_map::iterator requires Value to be complete type)
2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/53339
* include/bits/hashtable_policy.h (__detail::_Identity,
__detail::_Select1st): Add.
(_Map_base, _Hashtable_base): Use the latter, adjust parameters.
* include/bits/hashtable.h (_Hashtable::__key_extract): Adjust.
* include/bits/unordered_set.h (__uset_hashtable, __umset_hashtable):
Likewise.
* include/bits/unordered_map.h (__umap_hashtable, __ummap_hashtable):
Likewise.
* include/bits/stl_function.h (_Identity, _Select1st, _Select2nd)
Unconditionally derive from unary_function.
* include/ext/functional (identity, select1st, select2nd): Remove
#ifdef __GXX_EXPERIMENTAL_CXX0X__ bits.
* testsuite/23_containers/unordered_map/requirements/53339.cc: New.
* testsuite/23_containers/unordered_multimap/requirements/
53339.cc: Likewise.
From-SVN: r187515
Diffstat (limited to 'libstdc++-v3/testsuite')
3 files changed, 70 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc index d2694e2..a6881dbc 100644 --- a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc +++ b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc @@ -2,7 +2,7 @@ // { dg-options "-std=gnu++0x" } // { dg-require-cstdint "" } -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation // // 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 @@ -51,5 +51,5 @@ test04() // { dg-error "required from here" "" { target *-*-* } 46 } // { dg-error "denominator cannot be zero" "" { target *-*-* } 265 } // { dg-error "out of range" "" { target *-*-* } 266 } -// { dg-error "overflow in constant expression" "" { target *-*-* } 61 } +// { dg-error "overflow in constant expression" "" { target *-*-* } 62 } // { dg-prune-output "not a member" } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53339.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53339.cc new file mode 100644 index 0000000..809b10d --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53339.cc @@ -0,0 +1,34 @@ +// { 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> + +struct LinkedHashMap +{ + struct Entry; + + typedef std::unordered_map<int, Entry> Storage; + typedef Storage::iterator EntryPtr; + + struct Entry + { + EntryPtr prev, next; + }; +}; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/53339.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/53339.cc new file mode 100644 index 0000000..9272133 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/53339.cc @@ -0,0 +1,34 @@ +// { 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> + +struct LinkedHashMap +{ + struct Entry; + + typedef std::unordered_multimap<int, Entry> Storage; + typedef Storage::iterator EntryPtr; + + struct Entry + { + EntryPtr prev, next; + }; +}; |