Commit 3e64a626 by Jonathan Wakely Committed by Jonathan Wakely

Improve libstdc++ docs w.r.t newer C++ standards

Instead of repeating all the old headers for every new standard I've
changed the docs to only list the new headers for each standard.

	* doc/xml/manual/test.xml: Improve documentation on writing tests for
	newer standards.
	* doc/xml/manual/using.xml: Document all headers for C++11 and later.
	* doc/html/*: Regenerate.

From-SVN: r263163
parent 77a6c969
2018-07-31 Jonathan Wakely <jwakely@redhat.com> 2018-07-31 Jonathan Wakely <jwakely@redhat.com>
* doc/xml/manual/test.xml: Improve documentation on writing tests for
newer standards.
* doc/xml/manual/using.xml: Document all headers for C++11 and later.
* doc/html/*: Regenerate.
* include/ext/pointer.h [__cplusplus >= 201103L] * include/ext/pointer.h [__cplusplus >= 201103L]
(_Pointer_adapter::operator bool): Add explicit conversion operator (_Pointer_adapter::operator bool): Add explicit conversion operator
to replace safe bool idiom. to replace safe bool idiom.
......
...@@ -526,4 +526,18 @@ ...@@ -526,4 +526,18 @@
<code class="code">weak_ptr::owner_before</code> <code class="code">weak_ptr::owner_before</code>
</em></span> </em></span>
</span></dt><dd><p>Add noexcept. </span></dt><dd><p>Add noexcept.
</p></dd><dt><a id="manual.bugs.dr2993"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2993" target="_top">2993</a>:
<span class="emphasis"><em><code class="code">reference_wrapper&lt;T&gt;</code> conversion from <code class="code">T&amp;&amp;</code>
</em></span>
</span></dt><dd><p>Replaced the constructors with a constrained template,
to prevent participation in overload resolution when not valid.
</p></dd><dt><a id="manual.bugs.dr3074"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#3074" target="_top">3074</a>:
<span class="emphasis"><em>Non-member functions for <code class="code">valarray</code> should only deduce from the <code class="code">valarray</code>
</em></span>
</span></dt><dd><p>Change scalar operands to be non-deduced context, so that
they will allow conversions from other types to the value_type.
</p></dd><dt><a id="manual.bugs.dr3076"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#3076" target="_top">3076</a>:
<span class="emphasis"><em><code class="code">basic_string</code> CTAD ambiguity
</em></span>
</span></dt><dd><p>Change constructors to constrained templates.
</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="status.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html> </p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="status.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Setup</td></tr></table></div></body></html>
\ No newline at end of file
...@@ -875,7 +875,11 @@ and test for <code class="code">__STDCPP_MATH_SPEC_FUNCS__ &gt;= 201003L</code>. ...@@ -875,7 +875,11 @@ and test for <code class="code">__STDCPP_MATH_SPEC_FUNCS__ &gt;= 201003L</code>.
<a class="link" href="http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/p0013r1.html" target="_top"> <a class="link" href="http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/p0013r1.html" target="_top">
P0013R1 P0013R1
</a> </a>
</td><td align="left">Logical Operator Type Traits (revision 1)</td><td align="left">Y</td><td align="left">Library Fundamentals 2 TS</td></tr></tbody></table></div></div><br class="table-break" /><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="iso.2017.specific"></a>Implementation Specific Behavior</h4></div></div></div><p>For behaviour which is also specified by previous standards, </td><td align="left">Logical Operator Type Traits (revision 1)</td><td align="left">Y</td><td align="left">Library Fundamentals 2 TS</td></tr><tr><td align="left">
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4531.html" target="_top">
N4531
</a>
</td><td align="left">std::rand replacement, revision 3</td><td align="left">Y</td><td align="left">Library Fundamentals 2 TS</td></tr></tbody></table></div></div><br class="table-break" /><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="iso.2017.specific"></a>Implementation Specific Behavior</h4></div></div></div><p>For behaviour which is also specified by previous standards,
see <a class="link" href="status.html#iso.1998.specific" title="Implementation Specific Behavior">C++ 1998/2003 Implementation see <a class="link" href="status.html#iso.1998.specific" title="Implementation Specific Behavior">C++ 1998/2003 Implementation
Specific Behavior</a> and <a class="link" href="status.html#iso.2011.specific" title="Implementation Specific Behavior">C++ Specific Behavior</a> and <a class="link" href="status.html#iso.2011.specific" title="Implementation Specific Behavior">C++
2011 Implementation Specific Behavior</a>. This section only 2011 Implementation Specific Behavior</a>. This section only
......
...@@ -464,12 +464,15 @@ cat 27_io/objects/char/3_xin.in | a.out</pre></dd><dt><span class="term"><code c ...@@ -464,12 +464,15 @@ cat 27_io/objects/char/3_xin.in | a.out</pre></dd><dt><span class="term"><code c
possible variations. possible variations.
</p><p> </p><p>
Similarly, tests which depend on a newer standard than the default Similarly, tests which depend on a newer standard than the default
should use <code class="literal">dg-options</code> instead of an effective target, must use <code class="literal">dg-options</code> instead of (or in addition to)
so that they are not skipped by default. an effective target, so that they are not skipped by default.
For example, tests for C++17 features should use For example, tests for C++17 features should use
</p><pre class="programlisting"> // { dg-options "-std=gnu++17" }</pre><p> </p><pre class="programlisting"> // { dg-options "-std=gnu++17" }</pre><p>
and not before any <code class="literal">dg-do</code> such as:
</p><pre class="programlisting"> // { dg-do run "c++1z" }</pre><p> </p><pre class="programlisting"> // { dg-do run "c++17" }</pre><p>
The <code class="literal">dg-options</code> directive must come first, so that
the <code class="literal">-std</code> flag has already been added to the options
before checking the <code class="literal">c++17</code> target.
</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="tests.dg.examples"></a>Examples of Test Directives</h4></div></div></div><p> </p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="tests.dg.examples"></a>Examples of Test Directives</h4></div></div></div><p>
Example 1: Testing compilation only: Example 1: Testing compilation only:
</p><pre class="programlisting"> </p><pre class="programlisting">
......
...@@ -763,12 +763,15 @@ cat 27_io/objects/char/3_xin.in | a.out</programlisting> ...@@ -763,12 +763,15 @@ cat 27_io/objects/char/3_xin.in | a.out</programlisting>
<para> <para>
Similarly, tests which depend on a newer standard than the default Similarly, tests which depend on a newer standard than the default
should use <literal>dg-options</literal> instead of an effective target, must use <literal>dg-options</literal> instead of (or in addition to)
so that they are not skipped by default. an effective target, so that they are not skipped by default.
For example, tests for C++17 features should use For example, tests for C++17 features should use
<programlisting> // { dg-options "-std=gnu++17" }</programlisting> <programlisting> // { dg-options "-std=gnu++17" }</programlisting>
and not before any <literal>dg-do</literal> such as:
<programlisting> // { dg-do run "c++1z" }</programlisting> <programlisting> // { dg-do run "c++17" }</programlisting>
The <literal>dg-options</literal> directive must come first, so that
the <literal>-std</literal> flag has already been added to the options
before checking the <literal>c++17</literal> target.
</para> </para>
<section xml:id="tests.dg.examples"><info><title>Examples of Test Directives</title></info> <section xml:id="tests.dg.examples"><info><title>Examples of Test Directives</title></info>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment