public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [wwwdocs] Document libstdc++ header dependency changes
@ 2020-11-26 11:33 Jonathan Wakely
  2020-11-26 11:53 ` Jonathan Wakely
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2020-11-26 11:33 UTC (permalink / raw)
  To: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 87 bytes --]

Also explain how to replace dynamic exception specifications.

Committed to wwwdocs.



[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2054 bytes --]

commit 611da69f7782376d2737fe683f5db7ea7a5cdb31
Author: Jonathan Wakely <jwakely@redhat.com>
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.
 <p>
 GCC 11 defaults to C++17 which does not allow dynamic exception specifications.
 </p>
+<p>
+An exception specification like <code>throw(std::runtime_error)</code> should
+be removed or replaced with <code>noexcept(false)</code> (meaning the function
+can throw any type of exception).
+An exception specification like <code>throw()</code> can be replaced with
+<code>noexcept</code> or <code>noexcept(true)</code> (meaning the function
+does not throw exceptions).
+</p>
 
 <h3 id="Comparison-Functions">Comparison Functions</h3>
 <p>
 GCC 11 now enforces that comparison objects be invocable as const.
+</p>
+
+<h3 id="header-dep-changes">Header dependency changes</h3>
+<p>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.
+</p>
+<p>
+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:
+</p>
+<ul>
+<li> <code>&lt;limits&gt;</code>
+  (e.g. for <code>std::numeric_limits</code>)
+</li>
+<li> <code>&lt;memory&gt;</code>
+  (e.g. for <code>std::unique_ptr</code>, <code>std::shared_ptr</code> etc.)
+</li>
+<li> <code>&lt;utility&gt;</code>
+  (for <code>std::pair</code>, <code>std::tuple_size</code>,
+  <code>std::index_sequence</code> etc.)
+</li>
+</ul>
 
 <!--
 <h2 id="fortran">Fortran language issues</h2>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [wwwdocs] Document libstdc++ header dependency changes
  2020-11-26 11:33 [wwwdocs] Document libstdc++ header dependency changes Jonathan Wakely
@ 2020-11-26 11:53 ` Jonathan Wakely
  2020-12-01 21:58   ` Gerald Pfeifer
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2020-11-26 11:53 UTC (permalink / raw)
  To: Jonathan Wakely via Libstdc++; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

On 26/11/20 11:33 +0000, Jonathan Wakely via Libstdc++ wrote:
>Also explain how to replace dynamic exception specifications.

And a small correction.

Committed to wwwdocs.


[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1429 bytes --]

commit df8e807fa3d534472e1b2084b5fcfc761888ccbc
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Nov 26 11:51:57 2020 +0000

    Fix typo and wording of previous commit

diff --git a/htdocs/gcc-11/porting_to.html b/htdocs/gcc-11/porting_to.html
index 91cd0b4d..41efc3b6 100644
--- a/htdocs/gcc-11/porting_to.html
+++ b/htdocs/gcc-11/porting_to.html
@@ -95,19 +95,18 @@ GCC 11 now enforces that comparison objects be invocable as const.
 <p>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.
+including the right headers will no longer compile.
 </p>
 <p>
 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:
+be included explicitly when compiled with GCC 11:
 </p>
 <ul>
 <li> <code>&lt;limits&gt;</code>
-  (e.g. for <code>std::numeric_limits</code>)
+  (for <code>std::numeric_limits</code>)
 </li>
 <li> <code>&lt;memory&gt;</code>
-  (e.g. for <code>std::unique_ptr</code>, <code>std::shared_ptr</code> etc.)
+  (for <code>std::unique_ptr</code>, <code>std::shared_ptr</code> etc.)
 </li>
 <li> <code>&lt;utility&gt;</code>
   (for <code>std::pair</code>, <code>std::tuple_size</code>,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [wwwdocs] Document libstdc++ header dependency changes
  2020-11-26 11:53 ` Jonathan Wakely
@ 2020-12-01 21:58   ` Gerald Pfeifer
  2020-12-01 22:06     ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Gerald Pfeifer @ 2020-12-01 21:58 UTC (permalink / raw)
  To: gcc-patches, libstdc++

On Thu, 26 Nov 2020, Jonathan Wakely via Gcc-patches wrote:
>> Also explain how to replace dynamic exception specifications.
> And a small correction.

Ah, I was going to point that out. :-)

Let's see how many ports/packages the header cleanup is going to break 
this time.  Updating the default version of GCC in FreeBSD has proven a 
painful endeavour the last few times (though the GCC 10 update is mostly 
delayed due to stricter behavior on the Fortran side).

Cheers,
Gerald

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [wwwdocs] Document libstdc++ header dependency changes
  2020-12-01 21:58   ` Gerald Pfeifer
@ 2020-12-01 22:06     ` Jeff Law
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2020-12-01 22:06 UTC (permalink / raw)
  To: Gerald Pfeifer, gcc-patches, libstdc++



On 12/1/20 2:58 PM, Gerald Pfeifer wrote:
> On Thu, 26 Nov 2020, Jonathan Wakely via Gcc-patches wrote:
>>> Also explain how to replace dynamic exception specifications.
>> And a small correction.
> Ah, I was going to point that out. :-)
>
> Let's see how many ports/packages the header cleanup is going to break 
> this time.  Updating the default version of GCC in FreeBSD has proven a 
> painful endeavour the last few times (though the GCC 10 update is mostly 
> delayed due to stricter behavior on the Fortran side).
I've already fixed ~100 in Fedora...  Those fixes are slowly trickling
to the appropriate upstreams.

Jeff


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-01 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 11:33 [wwwdocs] Document libstdc++ header dependency changes Jonathan Wakely
2020-11-26 11:53 ` Jonathan Wakely
2020-12-01 21:58   ` Gerald Pfeifer
2020-12-01 22:06     ` Jeff Law

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