public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Fix outdated docs about demangling exception messages
@ 2023-04-04 11:17 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-04-04 11:17 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Pushed to trunk.

-- >8 --

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.
---
 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/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 <stdexcept>, thrown by the implementation
-  // instead of the user
-  std::bad_exception  e;
-  realname = abi::__cxa_demangle(e.what(), 0, 0, &status);
-  std::cout << e.what() << "\t=> " << realname << "\t: " << status << '\n';
-  free(realname);
-
-
   // typeid
   bar<empty,17>          u;
   const std::type_info  &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>
 
-- 
2.39.2


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

only message in thread, other threads:[~2023-04-04 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-04 11:17 [committed] libstdc++: Fix outdated docs about demangling exception messages Jonathan Wakely

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