aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarti Brandt <hartmut.brandt@dlr.de>2011-11-18 16:09:29 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-11-18 16:09:29 +0000
commit919f402ca5eae1caf53ed2b9caffc9a50e92cdd0 (patch)
tree4de36f4fca46222c9e46098e3d4b32b266042e1f
parent112eadc76334c1709962ddf47ebf5b11bae685c1 (diff)
downloadgcc-919f402ca5eae1caf53ed2b9caffc9a50e92cdd0.zip
gcc-919f402ca5eae1caf53ed2b9caffc9a50e92cdd0.tar.gz
gcc-919f402ca5eae1caf53ed2b9caffc9a50e92cdd0.tar.bz2
re PR libstdc++/51209 (The template _M_find_node in hashtable.h has a bad return value)
2011-11-18 Harti Brandt <hartmut.brandt@dlr.de> PR libstdc++/51209 * include/bits/hashtable.h (_Hashtable<>::_M_find_node): Return nullptr when no node is found. * include/tr1/hashtable.h (_Hashtable<>::_M_find_node): Return zero when no node is found. From-SVN: r181480
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/include/bits/hashtable.h4
-rw-r--r--libstdc++-v3/include/tr1/hashtable.h4
3 files changed, 12 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0d68464..235aa05 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2011-11-18 Harti Brandt <hartmut.brandt@dlr.de>
+
+ PR libstdc++/51209
+ * include/bits/hashtable.h (_Hashtable<>::_M_find_node): Return
+ nullptr when no node is found.
+ * include/tr1/hashtable.h (_Hashtable<>::_M_find_node): Return
+ zero when no node is found.
+
2011-11-18 Paolo Carlini <paolo.carlini@oracle.com>
* src/hash-long-double-aux.cc: Rename to...
diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h
index 203999d..83cef2d 100644
--- a/libstdc++-v3/include/bits/hashtable.h
+++ b/libstdc++-v3/include/bits/hashtable.h
@@ -873,7 +873,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// Find the node whose key compares equal to k, beginning the search
- // at p (usually the head of a bucket). Return nil if no node is found.
+ // at p (usually the head of a bucket). Return nullptr if no node is found.
template<typename _Key, typename _Value,
typename _Allocator, typename _ExtractKey, typename _Equal,
typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
@@ -889,7 +889,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
for (; __p; __p = __p->_M_next)
if (this->_M_compare(__k, __code, __p))
return __p;
- return false;
+ return nullptr;
}
// Insert v in bucket n (assumes no element with its key already present).
diff --git a/libstdc++-v3/include/tr1/hashtable.h b/libstdc++-v3/include/tr1/hashtable.h
index 5d1e02c..5e17b23 100644
--- a/libstdc++-v3/include/tr1/hashtable.h
+++ b/libstdc++-v3/include/tr1/hashtable.h
@@ -813,7 +813,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// Find the node whose key compares equal to k, beginning the search
- // at p (usually the head of a bucket). Return nil if no node is found.
+ // at p (usually the head of a bucket). Return zero if no node is found.
template<typename _Key, typename _Value,
typename _Allocator, typename _ExtractKey, typename _Equal,
typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
@@ -829,7 +829,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
for (; __p; __p = __p->_M_next)
if (this->_M_compare(__k, __code, __p))
return __p;
- return false;
+ return 0;
}
// Insert v in bucket n (assumes no element with its key already present).