diff options
author | fdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-05 19:36:15 +0000 |
---|---|---|
committer | fdumont <fdumont@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-10-05 19:36:15 +0000 |
commit | ad88493b3589d5dcb1c4f9a624e808b67c81c43b (patch) | |
tree | fa1d1cfdd1367b56b51da8bbeac141ae64b7f5d1 /libstdc++-v3 | |
parent | 6d2efab4454ae9347c6cb2b1b892c9a0413b8d28 (diff) | |
download | ppe42-gcc-ad88493b3589d5dcb1c4f9a624e808b67c81c43b.tar.gz ppe42-gcc-ad88493b3589d5dcb1c4f9a624e808b67c81c43b.zip |
2014-10-05 François Dumont <fdumont@gcc.gnu.org>
PR libstdc++/63456
* include/bits/hashtable.h (_M_uses_single_bucket(__bucket_type*)): Test
the parameter.
* testsuite/23_containers/unordered_set/63456.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@215906 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/hashtable.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_set/63456.cc | 34 |
3 files changed, 42 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6faffb117da..6f7fada07d9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2014-10-05 François Dumont <fdumont@gcc.gnu.org> + + PR libstdc++/63456 + * include/bits/hashtable.h (_M_uses_single_bucket(__bucket_type*)): Test + the parameter. + * testsuite/23_containers/unordered_set/63456.cc: New. + 2014-10-03 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/63449 diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index 588e69c9d4d..894e52661d8 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -326,7 +326,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _M_uses_single_bucket(__bucket_type* __bkts) const - { return __builtin_expect(_M_buckets == &_M_single_bucket, false); } + { return __builtin_expect(__bkts == &_M_single_bucket, false); } bool _M_uses_single_bucket() const diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/63456.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/63456.cc new file mode 100644 index 00000000000..eba363c00f6 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/63456.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2014 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 "-std=gnu++11" } + +#include <unordered_set> + +void test01() +{ + std::unordered_set<int> s1, s2; + s2.insert(2); + + s1 = s2; +} + +int main() +{ + test01(); + return 0; +} |