[Bug libstdc++/51142] New: [C++0x] map::erase(key) doesn't compile with -D_GLIBCXX_DEBUG.
pluto at agmk dot net
gcc-bugzilla@gcc.gnu.org
Tue Nov 15 16:33:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51142
Bug #: 51142
Summary: [C++0x] map::erase(key) doesn't compile with
-D_GLIBCXX_DEBUG.
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pluto@agmk.net
Created attachment 25828
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25828
testcase
$ LANG=C make
g++ -Wall -std=c++0x t.cpp -c --save-temps -D_GLIBCXX_DEBUG
In file included from /usr/include/c++/4.6.2/debug/map:34:0,
from /usr/include/c++/4.6.2/map:66,
from t.cpp:2:
/usr/include/c++/4.6.2/debug/map.h: In member function 'std::__debug::map<_Key,
_Tp, _Compare, _Allocator>::size_type std::__debug::map<_Key, _Tp, _Compare,
_Allocator>::erase(const key_type&) [with _Key = boost::variant<bool>, _Tp =
unsigned int, _Compare = std::less<boost::variant<bool> >, _Allocator =
std::allocator<std::pair<const boost::variant<bool>, unsigned int> >,
std::__debug::map<_Key, _Tp, _Compare, _Allocator>::size_type = long unsigned
int, std::__debug::map<_Key, _Tp, _Compare, _Allocator>::key_type =
boost::variant<bool>]':
t.cpp:10:15: instantiated from here
/usr/include/c++/4.6.2/debug/map.h:295:6: error: call of overloaded
'erase(std::__debug::map<boost::variant<bool>, unsigned int>::_Base_iterator&)'
is ambiguous
/usr/include/c++/4.6.2/debug/map.h:295:6: note: candidates are:
/usr/include/c++/4.6.2/bits/stl_map.h:613:7: note: std::__cxx1998::map<_Key,
_Tp, _Compare, _Alloc>::iterator std::__cxx1998::map<_Key, _Tp, _Compare,
_Alloc>::erase(std::__cxx1998::map<_Key, _Tp, _Compare,
_Alloc>::const_iterator) [with _Key = boost::variant<bool>, _Tp = unsigned int,
_Compare = std::less<boost::variant<bool> >, _Alloc =
std::allocator<std::pair<const boost::variant<bool>, unsigned int> >,
std::__cxx1998::map<_Key, _Tp, _Compare, _Alloc>::iterator =
std::_Rb_tree_iterator<std::pair<const boost::variant<bool>, unsigned int> >,
std::__cxx1998::map<_Key, _Tp, _Compare, _Alloc>::const_iterator =
std::_Rb_tree_const_iterator<std::pair<const boost::variant<bool>, unsigned
int> >]
/usr/include/c++/4.6.2/bits/stl_map.h:643:7: note: std::__cxx1998::map<_Key,
_Tp, _Compare, _Alloc>::size_type std::__cxx1998::map<_Key, _Tp, _Compare,
_Alloc>::erase(const key_type&) [with _Key = boost::variant<bool>, _Tp =
unsigned int, _Compare = std::less<boost::variant<bool> >, _Alloc =
std::allocator<std::pair<const boost::variant<bool>, unsigned int> >,
std::__cxx1998::map<_Key, _Tp, _Compare, _Alloc>::size_type = long unsigned
int, std::__cxx1998::map<_Key, _Tp, _Compare, _Alloc>::key_type =
boost::variant<bool>]
make: *** [all] Error 1
More information about the Gcc-bugs
mailing list