From patchwork Thu May 10 11:17:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 911362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-477483-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="P3qmcGA/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40hW1V296Dz9s0y for ; Thu, 10 May 2018 21:18:20 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=CJ0RtBQPlKr+g/UCbtW+HUKvDUSO70TouZOg/9/KYykQuidz7dkeG ixSu+DYxBXIhrT2SV6cUeCqXczpuqpQ0ALT2KwAOoIyD/+nMU8lwfZr80EBGXGJz bSzP7EHBiZ00SYpSYTrj6BoyULUPEYUZ5HnRrTq4EzuZ8FbZOOS35w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=2Xl2Iiz+JPrwvZLfZx8K89lzFio=; b=P3qmcGA/PSgfW1NWNh6V ls8HchhxlCa8llaZcFiIp5XefRxQLv19nVsYWswEpEotMbbU0bN8vl6S9Ty7o8+d Ds5LQMXe5F/Xow0arEbfyi1WXtNCONptKdS1AMTKXL0eoSrWvh0a046GZwTh10HR tCIoawXb4Vd3bhDZ8E+viMM= Received: (qmail 80857 invoked by alias); 10 May 2018 11:18:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 79770 invoked by uid 89); 10 May 2018 11:18:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=5x, 7.1, dual, Dual X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 11:17:55 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 15E9930C23A7; Thu, 10 May 2018 11:17:54 +0000 (UTC) Received: from localhost (unknown [10.33.36.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id B87FE5D6A8; Thu, 10 May 2018 11:17:53 +0000 (UTC) Date: Thu, 10 May 2018 12:17:52 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Document Dual ABI for std::ios_base::failure Message-ID: <20180510111752.GA15121@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.1 (2017-09-22) And a couple of other doc improvements, and regenerated the HTML pages. Please read the proposed change to using.xml and let me know if it's clear. * doc/xml/faq.xml: Link to C++17 status. Add note to outdated answer. * doc/xml/manual/debug_mode.xml: Add array and forward_list to list of C++11 containers with Debug Mode support. * doc/xml/manual/using.xml: Document Dual ABI for ios_base::failure. * doc/html/*: Regenerate. commit ef4d4c52eb0073627270d7b13a5bc2a89f6cef0d Author: Jonathan Wakely Date: Thu May 10 12:07:08 2018 +0100 Document Dual ABI for std::ios_base::failure * doc/xml/faq.xml: Link to C++17 status. Add note to outdated answer. * doc/xml/manual/debug_mode.xml: Add array and forward_list to list of C++11 containers with Debug Mode support. * doc/xml/manual/using.xml: Document Dual ABI for ios_base::failure. * doc/html/*: Regenerate. diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml index b0b1f98e641..edc07f16acb 100644 --- a/libstdc++-v3/doc/xml/faq.xml +++ b/libstdc++-v3/doc/xml/faq.xml @@ -742,15 +742,16 @@ except for some corner cases. Support for localization in locale may be incomplete on some non-GNU platforms. Also dependent on the underlying platform is support - for wchar_t and long - long specializations, and details of thread support. + for wchar_t and long long specializations, + and details of thread support. Long answer: See the implementation status pages for C++98, - TR1, and - C++11. - C++14. + TR1, + C++11, + C++14, and + C++17. @@ -891,6 +892,9 @@ + + This answer is old and probably no longer be relevant. + Another problem is the rel_ops namespace and the template comparison operator functions contained therein. If they become diff --git a/libstdc++-v3/doc/xml/manual/debug_mode.xml b/libstdc++-v3/doc/xml/manual/debug_mode.xml index 5082bbfb724..570c17ba28a 100644 --- a/libstdc++-v3/doc/xml/manual/debug_mode.xml +++ b/libstdc++-v3/doc/xml/manual/debug_mode.xml @@ -285,7 +285,19 @@ containers have additional debug capability. - + + std::array + array + __gnu_debug::array + <debug/array> + + + std::forward_list + forward_list + __gnu_debug::forward_list + <debug/forward_list> + + std::unordered_map unordered_map __gnu_debug::unordered_map diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml index 918703a5217..67f9cf5216b 100644 --- a/libstdc++-v3/doc/xml/manual/using.xml +++ b/libstdc++-v3/doc/xml/manual/using.xml @@ -1036,7 +1036,7 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe The _GLIBCXX_USE_CXX11_ABI macro (see -) controls whether + ) controls whether the declarations in the library headers use the old or new ABI. So the decision of which ABI to use can be made separately for each source file being compiled. @@ -1071,12 +1071,39 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe Although the standard exception types defined in - <stdexcept> use strings, they + <stdexcept> use strings, most are not defined twice, so that a std::out_of_range exception thrown in one file can always be caught by a suitable handler in another file, even if the two files are compiled with different ABIs. + One exception type does change when using the new ABI, namely + std::ios_base::failure. + This is necessary because the 2011 standard changed its base class from + std::exception to + std::system_error, which causes its layout to change. + Exceptions due to iostream errors are thrown by a function inside + libstdc++.so, so whether the thrown + exception uses the old std::ios_base::failure type + or the new one depends on the ABI that was active when + libstdc++.so was built, + not the ABI active in the user code that is using + iostreams. + This means that for a given build of GCC the type thrown is fixed. + In current releases the library throws a special type that can be caught + by handlers for either the old or new type, + but for GCC 7.1, 7.2 and 7.3 the library throws the new + std::ios_base::failure type, + and for GCC 5.x and 6.x the library throws the old type. + Catch handlers of type std::ios_base::failure + will only catch the exceptions if using a newer release, + or if the handler is compiled with the same ABI as the type thrown by + the library. + Handlers for std::exception will always catch + iostreams exceptions, because the old and new type both inherit from + std::exception. + +
Troubleshooting If you get linker errors about undefined references to symbols