From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 023FB3858C5E for ; Tue, 4 Apr 2023 11:17:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 023FB3858C5E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680607048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=azw8GnYl94EX6Q3lFgjCkj72uVstsBfMAG0E+SM8VNE=; b=OaGOE8Iu4PJVcUXmsmHgIg3LbGU+ZI7q5uwgZ5NVoR1nBRWgmjfVx1qBa+zJSZFmL0zUSp OTg9doEIWgy2SRpwnzEDqEgB3/Eotwg8orUTzey2N2Mi2TPrR2Fk3oVBu+GQLKjuCAQZCz 16UX9xoymGtidn642uZAoLjxbvmegvs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-EDFQ1HrzMrCkDUlaKgo8yw-1; Tue, 04 Apr 2023 07:17:25 -0400 X-MC-Unique: EDFQ1HrzMrCkDUlaKgo8yw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 71EA98030CF; Tue, 4 Apr 2023 11:17:25 +0000 (UTC) Received: from localhost (unknown [10.33.37.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3419C1121314; Tue, 4 Apr 2023 11:17:25 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix outdated docs about demangling exception messages Date: Tue, 4 Apr 2023 12:17:24 +0100 Message-Id: <20230404111724.243040-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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() - St13bad_exception => std::bad_exception : 0 3barI5emptyLi17EE => bar<empty, 17> : 0 @@ -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 + free() the returned char array.) -- 2.39.2