public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/12000] New: incorrect default allocator for std::vector class template
@ 2003-08-20 23:40 boris at kolpackov dot net
2003-08-20 23:46 ` [Bug libstdc++/12000] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: boris at kolpackov dot net @ 2003-08-20 23:40 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12000
Summary: incorrect default allocator for std::vector class
template
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: boris at kolpackov dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-gnu-linux
GCC host triplet: i386-gnu-linux
GCC target triplet: i386-gnu-linux
$ cat >vector_and_new.cpp
#include <vector>
#include <iostream>
using std::cerr;
using std::endl;
void*
operator new (std::size_t size) throw (std::bad_alloc)
{
cerr << "new" << endl;
return malloc (size);
}
void
operator delete (void* p) throw ()
{
cerr << "delete " << endl;
free (p);
}
int
main ()
{
int* pi = new int;
delete pi;
std::vector<int> (1);
}
$ g++ --version
g++ (GCC) 3.3 (Debian)
$ g++ ./vector_and_new.cpp
$ ./a.out
new
delete
new
$
-------------------------
I believe this program should (at least) either print
new
delete
-or-
new
delete
new
delete
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-08-20 23:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-20 23:40 [Bug libstdc++/12000] New: incorrect default allocator for std::vector class template boris at kolpackov dot net
2003-08-20 23:46 ` [Bug libstdc++/12000] " pinskia at gcc dot gnu dot org
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).