public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-05-31 14:56 brendan
  0 siblings, 0 replies; 8+ messages in thread
From: brendan @ 2001-05-31 14:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         3016
>Category:       libstdc++
>Synopsis:       stl_queue.h bugs wrt compliance
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 31 14:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     brendan@zen.org
>Release:        egcs3 branch
>Organization:
>Environment:

>Description:
Attached are some tweaks to the definition of queue and priority_queue to make the more compliant with the standard.

Specifically, the constructors in the current stl_queue.h are missing default arguments, and in some cases there are too many versions of the ctors.

Hope this helps,
B
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="diffs-queues.txt"
Content-Disposition: inline; filename="diffs-queues.txt"

2001-05-31  Brendan Kehoe  <brendan@zen.org>

	* include/bits/stl_queue.h (class priority_queue): Fix ctors to
	match the standard.

*** stl_queue.h.~1~	Fri May 25 19:27:04 2001
--- stl_queue.h	Thu May 31 21:28:27 2001
*************** protected:
*** 76,81 ****
    _Sequence c;
  public:
!   queue() : c() {}
!   explicit queue(const _Sequence& __c) : c(__c) {}
  
    bool empty() const { return c.empty(); }
--- 76,80 ----
    _Sequence c;
  public:
!   explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
  
    bool empty() const { return c.empty(); }
*************** protected:
*** 155,177 ****
    _Compare comp;
  public:
!   priority_queue() : c() {}
!   explicit priority_queue(const _Compare& __x) :  c(), comp(__x) {}
!   priority_queue(const _Compare& __x, const _Sequence& __s) 
      : c(__s), comp(__x) 
      { make_heap(c.begin(), c.end(), comp); }
  
    template <class _InputIterator>
-   priority_queue(_InputIterator __first, _InputIterator __last) 
-     : c(__first, __last) { make_heap(c.begin(), c.end(), comp); }
- 
-   template <class _InputIterator>
-   priority_queue(_InputIterator __first, 
-                  _InputIterator __last, const _Compare& __x)
-     : c(__first, __last), comp(__x) 
-     { make_heap(c.begin(), c.end(), comp); }
- 
-   template <class _InputIterator>
    priority_queue(_InputIterator __first, _InputIterator __last,
!                  const _Compare& __x, const _Sequence& __s)
    : c(__s), comp(__x)
    { 
--- 154,166 ----
    _Compare comp;
  public:
!   explicit priority_queue(const _Compare& __x = _Compare(),
! 			  const _Sequence& __s = _Sequence()) 
      : c(__s), comp(__x) 
      { make_heap(c.begin(), c.end(), comp); }
  
    template <class _InputIterator>
    priority_queue(_InputIterator __first, _InputIterator __last,
!                  const _Compare& __x = _Compare(),
! 		 const _Sequence& __s = _Sequence())
    : c(__s), comp(__x)
    { 


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

* Re: libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-06-05  8:26 Phil Edwards
  0 siblings, 0 replies; 8+ messages in thread
From: Phil Edwards @ 2001-06-05  8:26 UTC (permalink / raw)
  To: pme; +Cc: gcc-prs

The following reply was made to PR libstdc++/3016; it has been noted by GNATS.

From: Phil Edwards <pedwards@disaster.jaj.com>
To: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
Date: Tue, 5 Jun 2001 10:00:09 -0400

 On Tue, Jun 05, 2001 at 02:36:00PM -0000, Gabriel Dos Reis wrote:
 >  | ...  So I posted.  I'm now seeing
 >  |  that the problem wasn't caused by your patch and that my post was stupid.
 >  |  Objection withdrawn (now I need to hunt down the actual bug... grr, I hate
 >  |  looking at pt.c).
 >  
 >  Can youu post ypu testcase?
 
 Whatever it was has been fixed on both the mainline and branch.
 
 -- 
 pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
 devphil at several other less interesting addresses in various dot domains
 The gods do not protect fools.  Fools are protected by more capable fools.


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

* Re: libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-06-05  7:46 Gabriel Dos Reis
  0 siblings, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2001-06-05  7:46 UTC (permalink / raw)
  To: pme; +Cc: gcc-prs

The following reply was made to PR libstdc++/3016; it has been noted by GNATS.

From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Phil Edwards <pedwards@disaster.jaj.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
Date: 05 Jun 2001 16:33:27 +0200

 Phil Edwards <pedwards@disaster.jaj.com> writes:
 
 | The following reply was made to PR libstdc++/3016; it has been noted by GNATS.
 | 
 | From: Phil Edwards <pedwards@disaster.jaj.com>
 | To: brendan@zen.org
 | Cc: gcc-gnats@gcc.gnu.org
 | Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
 | Date: Thu, 31 May 2001 16:49:10 -0400
 | 
 |  On Thu, May 31, 2001 at 09:50:54PM -0000, brendan@zen.org wrote:
 |  > *************** protected:
 |  > *** 76,81 ****
 |  >     _Sequence c;
 |  >   public:
 |  > !   queue() : c() {}
 |  > !   explicit queue(const _Sequence& __c) : c(__c) {}
 |  >   
 |  >     bool empty() const { return c.empty(); }
 |  > --- 76,80 ----
 |  >     _Sequence c;
 |  >   public:
 |  > !   explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
 |  >   
 |  >     bool empty() const { return c.empty(); }
 |  
 |  I disagree with removing the copy ctor.  Just because it isn't
 |  mandated doesn't mean it isn't allowed.
 
 Hmm, I'm amused by this reasoning because "standard conformance" was
 claimed in order to ditch the previous code.  Now, suddenly, the same
 reasoning no longer applies for other parts.
 
 -- Gaby
 


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

* Re: libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-06-05  7:46 Gabriel Dos Reis
  0 siblings, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2001-06-05  7:46 UTC (permalink / raw)
  To: pme; +Cc: gcc-prs

The following reply was made to PR libstdc++/3016; it has been noted by GNATS.

From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Brendan Kehoe <brendan@zen.org>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
Date: 05 Jun 2001 16:36:31 +0200

 Brendan Kehoe <brendan@zen.org> writes:
 
 |      Phil> I disagree with removing the copy ctor.  Just because it isn't
 |      Phil> mandated doesn't mean it isn't allowed.  What if I wished to
 |      Phil> construct a vector-of-queue-of-T?  Queue wouldn't meet the
 |      Phil> copy-constructible requirement.
 |  
 |  Hmm, I believe the copy ctor is still there
 
 You're absolutely right.
 
 -- Gaby


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

* Re: libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-06-05  7:36 Gabriel Dos Reis
  0 siblings, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2001-06-05  7:36 UTC (permalink / raw)
  To: pme; +Cc: gcc-prs

The following reply was made to PR libstdc++/3016; it has been noted by GNATS.

From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Phil Edwards <pedwards@disaster.jaj.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
Date: 05 Jun 2001 16:35:11 +0200

 Phil Edwards <pedwards@disaster.jaj.com> writes:
 
 | The following reply was made to PR libstdc++/3016; it has been noted by GNATS.
 | 
 | From: Phil Edwards <pedwards@disaster.jaj.com>
 | To: Brendan Kehoe <brendan@zen.org>
 | Cc: gcc-gnats@gcc.gnu.org
 | Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
 | Date: Thu, 31 May 2001 17:07:25 -0400
 | 
 |  On Thu, May 31, 2001 at 11:16:02PM +0100, Brendan Kehoe wrote:
 |  > Hmm, I believe the copy ctor is still there, it's just now got the default
 |  
 |  The reason I had objected was that I tried copying a queue with your
 |  patch applied, and the ctor wasn't found.
 
 Then the bug should lye somewhere else.
 
 | ...  So I posted.  I'm now seeing
 |  that the problem wasn't caused by your patch and that my post was stupid.
 |  Objection withdrawn (now I need to hunt down the actual bug... grr, I hate
 |  looking at pt.c).
 
 Can youu post ypu testcase?
 
 -- Gaby


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

* Re: libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-05-31 15:26 Phil Edwards
  0 siblings, 0 replies; 8+ messages in thread
From: Phil Edwards @ 2001-05-31 15:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR libstdc++/3016; it has been noted by GNATS.

From: Phil Edwards <pedwards@disaster.jaj.com>
To: Brendan Kehoe <brendan@zen.org>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
Date: Thu, 31 May 2001 17:07:25 -0400

 On Thu, May 31, 2001 at 11:16:02PM +0100, Brendan Kehoe wrote:
 > Hmm, I believe the copy ctor is still there, it's just now got the default
 
 The reason I had objected was that I tried copying a queue with your
 patch applied, and the ctor wasn't found.  So I posted.  I'm now seeing
 that the problem wasn't caused by your patch and that my post was stupid.
 Objection withdrawn (now I need to hunt down the actual bug... grr, I hate
 looking at pt.c).
 
 Phil
 
 -- 
 pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
 devphil at several other less interesting addresses in various dot domains
 The gods do not protect fools.  Fools are protected by more capable fools.


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

* Re: libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-05-31 15:16 Brendan Kehoe
  0 siblings, 0 replies; 8+ messages in thread
From: Brendan Kehoe @ 2001-05-31 15:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR libstdc++/3016; it has been noted by GNATS.

From: Brendan Kehoe <brendan@zen.org>
To: Phil Edwards <pedwards@disaster.jaj.com>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
Date: Thu, 31 May 2001 23:16:02 +0100

 >>>>> "Phil" == Phil Edwards <pedwards@disaster.jaj.com> writes:
 
 On Thu, May 31, 2001 at 09:50:54PM -0000, brendan@zen.org wrote:
 > *************** protected:
 > *** 76,81 ****
 >     _Sequence c;
 >   public:
 > !   queue() : c() {}
 > !   explicit queue(const _Sequence& __c) : c(__c) {}
 >   
 >     bool empty() const { return c.empty(); }
 > --- 76,80 ----
 >     _Sequence c;
 >   public:
 > !   explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
 >   
 >     bool empty() const { return c.empty(); }
 
 
     Phil> I disagree with removing the copy ctor.  Just because it isn't
     Phil> mandated doesn't mean it isn't allowed.  What if I wished to
     Phil> construct a vector-of-queue-of-T?  Queue wouldn't meet the
     Phil> copy-constructible requirement.
 
 Hmm, I believe the copy ctor is still there, it's just now got the default
 argument that's required by the standard.  We remove the default constructor,
 making queue instead set up a container if one wasn't specified by whatever is
 creating the queue object.
 
 B
 
 -- 
 Brendan Kehoe                                               brendan@zen.org
 
 http://www.zen.org/~brendan/


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

* Re: libstdc++/3016: stl_queue.h bugs wrt compliance
@ 2001-05-31 15:16 Phil Edwards
  0 siblings, 0 replies; 8+ messages in thread
From: Phil Edwards @ 2001-05-31 15:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR libstdc++/3016; it has been noted by GNATS.

From: Phil Edwards <pedwards@disaster.jaj.com>
To: brendan@zen.org
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/3016: stl_queue.h bugs wrt compliance
Date: Thu, 31 May 2001 16:49:10 -0400

 On Thu, May 31, 2001 at 09:50:54PM -0000, brendan@zen.org wrote:
 > *************** protected:
 > *** 76,81 ****
 >     _Sequence c;
 >   public:
 > !   queue() : c() {}
 > !   explicit queue(const _Sequence& __c) : c(__c) {}
 >   
 >     bool empty() const { return c.empty(); }
 > --- 76,80 ----
 >     _Sequence c;
 >   public:
 > !   explicit queue(const _Sequence& __c = _Sequence()) : c(__c) {}
 >   
 >     bool empty() const { return c.empty(); }
 
 I disagree with removing the copy ctor.  Just because it isn't
 mandated doesn't mean it isn't allowed.  What if I wished to construct
 a vector-of-queue-of-T?  Queue wouldn't meet the copy-constructible
 requirement.
 
 Phil
 
 -- 
 pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
 devphil at several other less interesting addresses in various dot domains
 The gods do not protect fools.  Fools are protected by more capable fools.


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

end of thread, other threads:[~2001-06-05  8:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-31 14:56 libstdc++/3016: stl_queue.h bugs wrt compliance brendan
2001-05-31 15:16 Phil Edwards
2001-05-31 15:16 Brendan Kehoe
2001-05-31 15:26 Phil Edwards
2001-06-05  7:36 Gabriel Dos Reis
2001-06-05  7:46 Gabriel Dos Reis
2001-06-05  7:46 Gabriel Dos Reis
2001-06-05  8:26 Phil Edwards

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).