public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libstdc++/10378: cannot add object with inplace new into STL collections
@ 2003-04-11 14:56 nick.brook
  0 siblings, 0 replies; only message in thread
From: nick.brook @ 2003-04-11 14:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10378
>Category:       libstdc++
>Synopsis:       cannot add object with inplace new into STL collections
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 11 14:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     nick.brook@3glab.com
>Release:        3.0.4
>Organization:
>Environment:
Linux (Debian testing)
>Description:
The following chunk of code doesn't compile - there seems to be a problem with adding objects that define a simple inplace new operator to STL collection classes. Note that the code WILL compile if the second new operator if defined instead of the first one. I first came across this when recompiling some code that uses IBM's ICU Unicode library, as their UnicodeString class now defines an inplace new & delete operator in the base class. This means i can't add UnicodeString objects to an STL list without amending the original ICU library.
>How-To-Repeat:
Just compile.	
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="tst.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="tst.cc"

I2luY2x1ZGUgPGxpc3Q+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCmNsYXNzIEJvYgp7CnB1YmxpYzoK
ICAgIC8vIFdvbid0IGNvbXBpbGUgd2l0aCB0aGlzIG5ldyBvcGVyYXRvciAKICAgIHN0YXRpYyB2
b2lkICogb3BlcmF0b3IgbmV3KHNpemVfdCBzeikKICAgIHsKICAgICAgICByZXR1cm4gbWFsbG9j
KHN6KTsKICAgIH0KCgogICAgLy8gV2lsbCBjb21waWxlIHdpdGggdGhpcyBvcGVyYXRvcgovLyAg
ICAgc3RhdGljIHZvaWQgKiBvcGVyYXRvciBuZXcoc2l6ZV90IHN6LCB2b2lkICopCi8vICAgICB7
Ci8vICAgICAgICAgcmV0dXJuIG1hbGxvYyhzeik7Ci8vICAgICB9Cn07CgppbnQgbWFpbihpbnQg
YXJnYywgY2hhciAqKmFyZ3YpCnsKICAgIHN0ZDo6bGlzdDxCb2I+IHVuaXNldDsKICAgIHVuaXNl
dC5wdXNoX2JhY2soQm9iKCkpOwogICAgcmV0dXJuIDA7Cn0KCiAgICAK


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-11 14:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-11 14:56 libstdc++/10378: cannot add object with inplace new into STL collections nick.brook

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