Your set::pointer defined as: > public: > typedef typename _Rep_type::const_pointer pointer; > typedef typename _Rep_type::const_pointer const_pointer; Where _Rep_type::const_pointer is: > typedef const value_type* const_pointer; But c++ standard 23.3.3 [lib.set] describes set::pointer as non-const pointer: > typedef typename Allocator::pointer pointer; > typedef typename Allocator::const_pointer const_pointer; This inconsistency raise inpossibility of implicit casting "set<char, less<char>, allocator<char> >::pointer" to "allocator<char>::pointer".
Created attachment 5352 [details] Test case to demonstrate bug
Confirmed, looks like a simple typo that has not been changed yet, I will submit a patch and your testcase.
A patch is here: <http://gcc.gnu.org/ml/gcc-patches/2003-12/msg01895.html>.
Updated patch also fixes reference: <http://gcc.gnu.org/ml/gcc-patches/2003-12/ msg01905.html>.
Subject: Bug 13462 CVSROOT: /cvs/gcc Module name: gcc Changes by: pinskia@gcc.gnu.org 2003-12-22 19:32:34 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_multiset.h stl_set.h libstdc++-v3/include/ext: hash_set Log message: 2003-12-22 Andrew Pinski <pinskia@physics.uc.edu> PR libstdc++/13462 * include/bits/stl_multiset.h (__gnu_norm::multiset): Define pointer as allocator's pointer, likewise for reference, const_pointer, and const_reference. * include/bits/stl_set.h (__gnu_norm::set): Likewise. * include/ext/hash_set (__gnu_ext::hash_set): Likewise. (__gnu_ext::hash_multiset): Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2179&r2=1.2180 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_multiset.h.diff?cvsroot=gcc&r1=1.16&r2=1.17 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_set.h.diff?cvsroot=gcc&r1=1.16&r2=1.17 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/ext/hash_set.diff?cvsroot=gcc&r1=1.16&r2=1.17
Fixed for 3.4.
Subject: Bug 13462 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: paolo@gcc.gnu.org 2004-01-28 16:34:08 Modified files: libstdc++-v3 : ChangeLog libstdc++-v3/include/bits: stl_multiset.h stl_set.h libstdc++-v3/include/ext: hash_set Log message: 2004-01-28 Andrew Pinski <pinskia@physics.uc.edu> PR libstdc++/13462 * include/bits/stl_multiset.h (std::multiset): Define pointer as allocator's pointer, likewise for reference, const_pointer, and const_reference. * include/bits/stl_set.h (std::set): Likewise. * include/ext/hash_set (__gnu_cxx::hash_set): Likewise. (__gnu_cxx::hash_multiset): Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.1464.2.174&r2=1.1464.2.175 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_multiset.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.11&r2=1.11.38.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_set.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.11&r2=1.11.38.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/ext/hash_set.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.12&r2=1.12.14.1