public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/9897: string.reserve/capacity does not work
@ 2003-03-01 16:37 paolo
  0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2003-03-01 16:37 UTC (permalink / raw)
  To: david, gcc-bugs, gcc-prs, nobody

Synopsis: string.reserve/capacity does not work

State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Sat Mar  1 16:37:05 2003
State-Changed-Why:
    According to the standard, should be >= 500.
    Indeed, the output for the current release of gcc
    (i.e., 3.2.2) is 611.
    I suggest updating your development tools: the 2.95.x
    branch is *very* old and not maintained anymore.
    Thanks for your report,
    Paolo.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9897


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

* libstdc++/9897: string.reserve/capacity does not work
@ 2003-03-01 13:16 david
  0 siblings, 0 replies; 2+ messages in thread
From: david @ 2003-03-01 13:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9897
>Category:       libstdc++
>Synopsis:       string.reserve/capacity does not work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 01 13:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Hill
>Release:        2.95.3
>Organization:
>Environment:
OpenBSD 3.3 i386
>Description:
//
// START OF SOURCE
//
#include <iostream>
#include <string>

int main(void)
{
    string test("david");
    string bad;

    bad.reserve(500);
    cout << "bad capacity: " << bad.capacity() << endl;
    
    cout << "test capacity before: " << test.capacity() << endl;
    test.reserve(500);
    cout << "test capacity after: " << test.capacity() << endl;

    return 0;
}
// END OF SOURCE

this code prints
bad capacity: 0
test capacity before: 16
test capacity after: 16

shouldn't the "test capacity after" be 500?
>How-To-Repeat:
compile the code and execute.
>Fix:
unknown
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-03-01 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-01 16:37 libstdc++/9897: string.reserve/capacity does not work paolo
  -- strict thread matches above, loose matches on Subject: below --
2003-03-01 13:16 david

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