re PR libstdc++/51209 (The template _M_find_node in hashtable.h has a bad return...
authorHarti Brandt <hartmut.brandt@dlr.de>
Fri, 18 Nov 2011 16:09:29 +0000 (16:09 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 18 Nov 2011 16:09:29 +0000 (16:09 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/include/tr1/hashtable.h

index 0d68464933c9ac6599e596905c460969845b16c0..235aa0578d479c576777f7bdae25790f48df0193 100644 (file)
@@ -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...
index 203999d9ca04c5bef069dcf79849b2de27f9b243..83cef2d4ca45031df1af72bd0380b9463d3deace 100644 (file)
@@ -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).
index 5d1e02c2592e154400007846b2ff245916b25ac2..5e17b238a1fc9dcf4654511c9941a39edac73474 100644 (file)
@@ -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).