This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/57065] New: incorrect default allocator template for debug and profile unordered_map
- From: "theonetruekenny at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Apr 2013 05:29:51 +0000
- Subject: [Bug libstdc++/57065] New: incorrect default allocator template for debug and profile unordered_map
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57065
Bug #: 57065
Summary: incorrect default allocator template for debug and
profile unordered_map
Classification: Unclassified
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: theonetruekenny@yahoo.com
In libstdc++-v3/include/debug/unordered_map and
libstdc++-v3/include/profile/unorderd_map, the unordered_map template is
defined as:
template<typename _Key, typename _Tp,
typename _Hash = std::hash<_Key>,
typename _Pred = std::equal_to<_Key>,
typename _Alloc = std::allocator<_Key> >
class unordered_map
however, the correct definition (as reflected in bits/unordered_map.h) is:
* @param Pred Predicate function object type, defaults to
equal_to<Value>.
* @param Alloc Allocator type, defaults to allocator<Key>.
*
* The resulting value type of the container is std::pair<const Key, Tp>.
*/
template<class _Key, class _Tp,
class _Hash = hash<_Key>,
class _Pred = std::equal_to<_Key>,
class _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
class unordered_map
note that the comment is wrong, but the code is correct.
See also: http://www.cplusplus.com/reference/unordered_map/unordered_map/ which
matches the definition in bits/unordered_map.h
As far as I can tell, this error has existed since gcc 4.3.