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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id E96D83851C01 for ; Thu, 26 Nov 2020 11:33:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E96D83851C01 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-215-PMAfDh7BO126UEoWcZ-j-g-1; Thu, 26 Nov 2020 06:33:12 -0500 X-MC-Unique: PMAfDh7BO126UEoWcZ-j-g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 094DC805BFD; Thu, 26 Nov 2020 11:33:11 +0000 (UTC) Received: from localhost (unknown [10.33.37.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9384D60855; Thu, 26 Nov 2020 11:33:10 +0000 (UTC) Date: Thu, 26 Nov 2020 11:33:09 +0000 From: Jonathan Wakely To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: [wwwdocs] Document libstdc++ header dependency changes Message-ID: <20201126113309.GA2103723@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline X-Spam-Status: No, score=-14.0 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_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2020 11:33:16 -0000 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Also explain how to replace dynamic exception specifications. Committed to wwwdocs. --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 611da69f7782376d2737fe683f5db7ea7a5cdb31 Author: Jonathan Wakely Date: Thu Nov 26 11:31:02 2020 +0000 Document libstdc++ header dependency changes Also explain how to replace dynamic exception specifications. diff --git a/htdocs/gcc-11/porting_to.html b/htdocs/gcc-11/porting_to.html index 1e27064c..91cd0b4d 100644 --- a/htdocs/gcc-11/porting_to.html +++ b/htdocs/gcc-11/porting_to.html @@ -77,10 +77,43 @@ equality comparisons, not ordered comparisons.

GCC 11 defaults to C++17 which does not allow dynamic exception specifications.

+

+An exception specification like throw(std::runtime_error) should +be removed or replaced with noexcept(false) (meaning the function +can throw any type of exception). +An exception specification like throw() can be replaced with +noexcept or noexcept(true) (meaning the function +does not throw exceptions). +

Comparison Functions

GCC 11 now enforces that comparison objects be invocable as const. +

+ +

Header dependency changes

+

Some C++ Standard Library headers have been changed to no longer include +other headers that they do need to depend on. +As such, C++ programs that used standard library components without +including the right headers will no longer compiler. +

+

+The following headers are used less widely in libstdc++ and may need to +be included explicitly by programs that were incorrectly relying on them +being included implicitly by other headers: +

+
    +
  • <limits> + (e.g. for std::numeric_limits) +
  • +
  • <memory> + (e.g. for std::unique_ptr, std::shared_ptr etc.) +
  • +
  • <utility> + (for std::pair, std::tuple_size, + std::index_sequence etc.) +
  • +