Open Bug 556701 Opened 10 years ago Updated 10 years ago

STL: Review exception safety of <vector> on gcc and MSVC


(Core :: XPCOM, enhancement)

Not set




(Reporter: cjones, Unassigned)


(Blocks 1 open bug)


No description provided.
Blocks: 564608
/usr/include/c++/4.2.1/stl_vector.h:767 has a try/catch block.  Is that safe?
Yes.  The block is attempting to catch std::bad_alloc, but (i) try/catch are ignored in -fno-exceptions; (ii) Gecko overrides ::operator new() (which std::allocator uses) with an implementation that never throws bad_alloc.
Then I can confirm that <vector> is safe for gcc 4.2.1 (on mac, but I don't expect the header to be different on linux).

Do we need to look at other gcc versions as well?
I can also confirm the safety of the <vector> header on MSVC 2008.
<vector> changed a fair amount in 4.4.  Not sure about 4.5.
I also checked the gcc libstd++ trunk source, and it looks good to me.  This <> makes me much happier as well.  :-)
You need to log in before you can comment on or make changes to this bug.