public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r10-11323] libstdc++: Fix outdated docs about demangling exception messages
Date: Thu, 27 Apr 2023 23:04:44 +0000 (GMT)	[thread overview]
Message-ID: <20230427230444.939EA3856267@sourceware.org> (raw)

https://gcc.gnu.org/g:c73f20e67ee8d268bf0dfd6732c1bd3e79e098ca

commit r10-11323-gc73f20e67ee8d268bf0dfd6732c1bd3e79e098ca
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Apr 4 12:04:14 2023 +0100

    libstdc++: Fix outdated docs about demangling exception messages
    
    The string returned by std::bad_exception::what() hasn't been a mangled
    name since PR libstdc++/14493 was fixed for GCC 4.2.0, so remove the
    docs showing how to demangle it.
    
    libstdc++-v3/ChangeLog:
    
            * doc/xml/manual/extensions.xml: Remove std::bad_exception from
            example program.
            * doc/html/manual/ext_demangling.html: Regenerate.
    
    (cherry picked from commit 688d126b69215db29774c249b052e52d765782b3)

Diff:
---
 libstdc++-v3/doc/html/manual/ext_demangling.html | 13 ++-----------
 libstdc++-v3/doc/xml/manual/extensions.xml       | 13 ++-----------
 2 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/libstdc++-v3/doc/html/manual/ext_demangling.html b/libstdc++-v3/doc/html/manual/ext_demangling.html
index 879497f7d08..028ec71d8c8 100644
--- a/libstdc++-v3/doc/html/manual/ext_demangling.html
+++ b/libstdc++-v3/doc/html/manual/ext_demangling.html
@@ -39,14 +39,6 @@ int main()
   int     status;
   char   *realname;
 
-  // exception classes not in &lt;stdexcept&gt;, thrown by the implementation
-  // instead of the user
-  std::bad_exception  e;
-  realname = abi::__cxa_demangle(e.what(), 0, 0, &amp;status);
-  std::cout &lt;&lt; e.what() &lt;&lt; "\t=&gt; " &lt;&lt; realname &lt;&lt; "\t: " &lt;&lt; status &lt;&lt; '\n';
-  free(realname);
-
-
   // typeid
   bar&lt;empty,17&gt;          u;
   const std::type_info  &amp;ti = typeid(u);
@@ -61,13 +53,12 @@ int main()
      This prints
    </p><pre class="screen">
    <code class="computeroutput">
-      St13bad_exception       =&gt; std::bad_exception   : 0
       3barI5emptyLi17EE       =&gt; bar&lt;empty, 17&gt;       : 0
    </code>
    </pre><p>
      The demangler interface is described in the source documentation
      linked to above.  It is actually written in C, so you don't need to
      be writing C++ in order to demangle C++.  (That also means we have to
-     use crummy memory management facilities, so don't forget to free()
-     the returned char array.)
+     use crummy memory management facilities, so don't forget to
+     <code class="code">free()</code> the returned char array.)
    </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ext_io.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="extensions.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ext_concurrency.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 27. Input and Output </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 29. Concurrency</td></tr></table></div></body></html>
\ No newline at end of file
diff --git a/libstdc++-v3/doc/xml/manual/extensions.xml b/libstdc++-v3/doc/xml/manual/extensions.xml
index 86e92beffd3..196b55d8347 100644
--- a/libstdc++-v3/doc/xml/manual/extensions.xml
+++ b/libstdc++-v3/doc/xml/manual/extensions.xml
@@ -534,14 +534,6 @@ int main()
   int     status;
   char   *realname;
 
-  // exception classes not in &lt;stdexcept&gt;, thrown by the implementation
-  // instead of the user
-  std::bad_exception  e;
-  realname = abi::__cxa_demangle(e.what(), 0, 0, &amp;status);
-  std::cout &lt;&lt; e.what() &lt;&lt; "\t=&gt; " &lt;&lt; realname &lt;&lt; "\t: " &lt;&lt; status &lt;&lt; '\n';
-  free(realname);
-
-
   // typeid
   bar&lt;empty,17&gt;          u;
   const std::type_info  &amp;ti = typeid(u);
@@ -559,7 +551,6 @@ int main()
 
    <screen>
    <computeroutput>
-      St13bad_exception       =&gt; std::bad_exception   : 0
       3barI5emptyLi17EE       =&gt; bar&lt;empty, 17&gt;       : 0
    </computeroutput>
    </screen>
@@ -568,8 +559,8 @@ int main()
      The demangler interface is described in the source documentation
      linked to above.  It is actually written in C, so you don't need to
      be writing C++ in order to demangle C++.  (That also means we have to
-     use crummy memory management facilities, so don't forget to free()
-     the returned char array.)
+     use crummy memory management facilities, so don't forget to
+     <code>free()</code> the returned char array.)
    </para>
 </chapter>

                 reply	other threads:[~2023-04-27 23:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230427230444.939EA3856267@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).