Bug 13462 - Non-standard conformed type set::pointer
Summary: Non-standard conformed type set::pointer
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.2
: P2 normal
Target Milestone: 3.3.3
Assignee: Andrew Pinski
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2003-12-22 10:51 UTC by Eugeny Klementev
Modified: 2004-01-28 16:34 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-12-22 15:55:50


Attachments
Test case to demonstrate bug (120 bytes, text/plain)
2003-12-22 10:55 UTC, Eugeny Klementev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugeny Klementev 2003-12-22 10:51:51 UTC
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".
Comment 1 Eugeny Klementev 2003-12-22 10:55:45 UTC
Created attachment 5352 [details]
Test case to demonstrate bug
Comment 2 Andrew Pinski 2003-12-22 15:55:49 UTC
Confirmed, looks like a simple typo that has not been changed yet, I will submit a patch and your 
testcase.
Comment 3 Andrew Pinski 2003-12-22 16:20:01 UTC
A patch is here: <http://gcc.gnu.org/ml/gcc-patches/2003-12/msg01895.html>.
Comment 4 Andrew Pinski 2003-12-22 18:51:23 UTC
Updated patch also fixes reference: <http://gcc.gnu.org/ml/gcc-patches/2003-12/
msg01905.html>.
Comment 5 CVS Commits 2003-12-22 19:32:39 UTC
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

Comment 6 Andrew Pinski 2003-12-22 19:34:12 UTC
Fixed for 3.4.
Comment 7 CVS Commits 2004-01-28 16:34:13 UTC
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