diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2018-08-10 21:20:27 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2018-08-10 21:20:27 +0100 |
commit | b66e5a95c0065fda3569a1bfd3766963a848a00d (patch) | |
tree | 53e48d628c8491683df2c3f5157fe66602679234 /libstdc++-v3/doc | |
parent | 6894c57b1e2c9068471f26f3d8d4f3f374126f52 (diff) | |
download | gcc-b66e5a95c0065fda3569a1bfd3766963a848a00d.tar.gz |
PR libstdc++/68210 adjust operator new and delete for LWG 206
Ensure that nothrow versions of new and delete call the ordinary
versions of new or delete, instead of calling malloc or free directly.
These files are all compiled with -std=gnu++14 so can use noexcept and
nullptr to make the code more readable.
PR libstdc++/68210
* doc/xml/manual/intro.xml: Document LWG 206 change.
* libsupc++/del_op.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
* libsupc++/del_opa.cc: Likewise.
* libsupc++/del_opant.cc: Likewise.
* libsupc++/del_opnt.cc: Likewise. Call operator delete(ptr) instead
of free(ptr).
* libsupc++/del_ops.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
* libsupc++/del_opsa.cc: Likewise.
* libsupc++/del_opva.cc: Likewise.
* libsupc++/del_opvant.cc: Likewise.
* libsupc++/del_opvnt.cc: Likewise. Call operator delete[](ptr)
instead of operator delete(ptr).
* libsupc++/del_opvs.cc: Replace _GLIBCXX_USE_NOEXCEPT with noexcept.
* libsupc++/del_opvsa.cc: Likewise.
* libsupc++/new_op.cc: Use __builtin_expect in check for zero size.
* libsupc++/new_opa.cc: Use nullptr instead of literal 0.
* libsupc++/new_opant.cc: Likewise. Replace _GLIBCXX_USE_NOEXCEPT
with noexcept.
* libsupc++/new_opnt.cc: Likewise. Call operator new(sz) instead of
malloc(sz).
* libsupc++/new_opvant.cc: Use nullptr and noexcept.
* libsupc++/new_opvnt.cc: Likewise. Call operator new[](sz) instead of
operator new(sz, nothrow).
* testsuite/18_support/new_nothrow.cc: New test.
From-SVN: r263478
Diffstat (limited to 'libstdc++-v3/doc')
-rw-r--r-- | libstdc++-v3/doc/xml/manual/intro.xml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml index fea07e2bb5f..cb187e1a2ed 100644 --- a/libstdc++-v3/doc/xml/manual/intro.xml +++ b/libstdc++-v3/doc/xml/manual/intro.xml @@ -440,6 +440,17 @@ requirements of the license of GCC. <listitem><para>Yes, it can, specifically if EOF is reached while skipping whitespace. </para></listitem></varlistentry> + <varlistentry xml:id="manual.bugs.dr206"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#206">206</link>: + <emphasis><code>operator new(size_t, nothrow)</code> may become + unlinked to ordinary <code>operator new</code> if ordinary + version replaced + </emphasis> + </term> + <listitem><para>The <code>nothrow</code> forms of new and delete were + changed to call the throwing forms, handling any exception by + catching it and returning a null pointer. + </para></listitem></varlistentry> + <varlistentry xml:id="manual.bugs.dr211"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#211">211</link>: <emphasis>operator>>(istream&, string&) doesn't set failbit</emphasis> </term> |