public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/15775] New: Allocator::pointer consistently ignored
@ 2004-06-02 12:22 carlo at gcc dot gnu dot org
  2004-06-09  9:45 ` [Bug libstdc++/15775] " pcarlini at suse dot de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: carlo at gcc dot gnu dot org @ 2004-06-02 12:22 UTC (permalink / raw)
  To: gcc-bugs

Many (if not all) STL containers use typedefs like:

      typedef value_type*                        pointer;
      typedef const value_type*                  const_pointer;
      typedef value_type&                        reference;
      typedef const value_type&                  const_reference;

However, according to the standard it should be Allocator::pointer etc.
For example, 23.2.1 Template class deque [lib.deque] says

namespace std {
  template <class T, class Allocator = allocator<T> >
  class deque {
  public:
    // types:
    typedef typename Allocator::reference         reference;
    typedef typename Allocator::const_reference   const_reference;
                                                                   // See 23.1
    typedef implementation defined                iterator;
                                                  const_iterator; // See 23.1
    typedef implementation defined
                                                                   // See 23.1
    typedef implementation defined                size_type;
                                                  difference_type; // See 23.1
    typedef implementation defined
    typedef T                                     value_type;
    typedef Allocator                             allocator_type;
    typedef typename Allocator::pointer           pointer;
    typedef typename Allocator::const_pointer     const_pointer;
    typedef std::reverse_iterator<iterator>       reverse_iterator;
    typedef std::reverse_iterator<const_iterator> const_reverse_iterator;


and since Allocator is a user specified class, it cannot be correct
to replace these 'typename Allocator::pointer' with 'value_type*'.

-- 
           Summary: Allocator::pointer consistently ignored
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carlo at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/15775] Allocator::pointer consistently ignored
  2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
@ 2004-06-09  9:45 ` pcarlini at suse dot de
  2004-06-09 10:10 ` pcarlini at suse dot de
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2004-06-09  9:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-06-09 09:45 -------
Confirmed: for some reason, when fixing libstdc++/13462 we didn't notice that
the problem was more general.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pcarlini at suse dot de
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-09 09:45:35
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/15775] Allocator::pointer consistently ignored
  2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
  2004-06-09  9:45 ` [Bug libstdc++/15775] " pcarlini at suse dot de
@ 2004-06-09 10:10 ` pcarlini at suse dot de
  2004-06-09 21:37 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2004-06-09 10:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-06-09 10:10 -------
Notice, however, that at variance with the specific cases fixed for 13462, the
remaining containers are essentially ok (i.e., the change is only cosmetic) due
to the Standard requirements for allocators (Table 32): allocator<T>::pointer
is required to be T*, for instance.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/15775] Allocator::pointer consistently ignored
  2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
  2004-06-09  9:45 ` [Bug libstdc++/15775] " pcarlini at suse dot de
  2004-06-09 10:10 ` pcarlini at suse dot de
@ 2004-06-09 21:37 ` cvs-commit at gcc dot gnu dot org
  2004-06-09 21:40 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-09 21:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-09 21:37 -------
Subject: Bug 15775

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2004-06-09 21:37:47

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: stl_deque.h stl_list.h stl_map.h 
	                           stl_multimap.h stl_vector.h 

Log message:
	2004-06-09  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/15775
	* include/bits/stl_deque.h: Consistently with stl_set.h, define
	pointer as allocator's pointer, likewise for reference,
	const_pointer, and const_reference.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_vector.h: Likewise.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2507&r2=1.2508
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_deque.h.diff?cvsroot=gcc&r1=1.49&r2=1.50
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&r1=1.40&r2=1.41
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_map.h.diff?cvsroot=gcc&r1=1.24&r2=1.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_multimap.h.diff?cvsroot=gcc&r1=1.23&r2=1.24
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_vector.h.diff?cvsroot=gcc&r1=1.48&r2=1.49



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/15775] Allocator::pointer consistently ignored
  2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-06-09 21:37 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-09 21:40 ` pcarlini at suse dot de
  2004-06-09 22:05 ` bkoz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2004-06-09 21:40 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4.1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/15775] Allocator::pointer consistently ignored
  2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-06-09 21:40 ` pcarlini at suse dot de
@ 2004-06-09 22:05 ` bkoz at gcc dot gnu dot org
  2004-06-11 18:45 ` cvs-commit at gcc dot gnu dot org
  2004-06-11 18:46 ` pcarlini at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-06-09 22:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-06-09 22:05 -------

paolo can you put this on gcc-3_4-branch too, at some date before 3.4.1?

thanks,
benjamin

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/15775] Allocator::pointer consistently ignored
  2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-06-09 22:05 ` bkoz at gcc dot gnu dot org
@ 2004-06-11 18:45 ` cvs-commit at gcc dot gnu dot org
  2004-06-11 18:46 ` pcarlini at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-11 18:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-11 18:45 -------
Subject: Bug 15775

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	paolo@gcc.gnu.org	2004-06-11 18:44:58

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/testsuite: testsuite_performance.h 
	libstdc++-v3/include/bits: stl_deque.h stl_list.h stl_map.h 
	                           stl_multimap.h stl_vector.h 

Log message:
	2004-06-11  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/15775
	* include/bits/stl_deque.h: Consistently with stl_set.h, define
	pointer as allocator's pointer, likewise for reference,
	const_pointer, and const_reference.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	
	2004-06-11  Dhruv Matani  <dhruvbird@gmx.net>
	Paolo Carlini  <pcarlini@suse.de>
	
	* testsuite/testsuite_performance.h
	(resource_counter::allocated_memory): Make it return the right
	number of bytes requested by the allocators/application. This is
	the sbrk+mmaped memory.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.124&r2=1.2224.2.125
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/testsuite_performance.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.11.4.1&r2=1.11.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_deque.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.44.4.3&r2=1.44.4.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.34.4.3&r2=1.34.4.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_map.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.19.6.2&r2=1.19.6.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_multimap.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.19.6.2&r2=1.19.6.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_vector.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.43.4.3&r2=1.43.4.4



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug libstdc++/15775] Allocator::pointer consistently ignored
  2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-06-11 18:45 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-11 18:46 ` pcarlini at suse dot de
  6 siblings, 0 replies; 8+ messages in thread
From: pcarlini at suse dot de @ 2004-06-11 18:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-06-11 18:46 -------
Fixed for 3.4.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15775


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-06-11 18:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-02 12:22 [Bug libstdc++/15775] New: Allocator::pointer consistently ignored carlo at gcc dot gnu dot org
2004-06-09  9:45 ` [Bug libstdc++/15775] " pcarlini at suse dot de
2004-06-09 10:10 ` pcarlini at suse dot de
2004-06-09 21:37 ` cvs-commit at gcc dot gnu dot org
2004-06-09 21:40 ` pcarlini at suse dot de
2004-06-09 22:05 ` bkoz at gcc dot gnu dot org
2004-06-11 18:45 ` cvs-commit at gcc dot gnu dot org
2004-06-11 18:46 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).