be run for a specific standard (and not later standards) using an
effective target like <code class="literal">c++11_only</code>. However, this means
the test will be skipped by default (because the default mode is
- <code class="literal">gnu++14</code>), and so will only run when
+ <code class="literal">gnu++17</code>), and so will only run when
<code class="option">-std=gnu++11</code> or <code class="option">-std=c++11</code> is used
explicitly. For tests that require a specific standard it is better to
use a <code class="literal">dg-options</code> directive:
Similarly, tests which depend on a newer standard than the default
must use <code class="literal">dg-options</code> instead of (or in addition to)
an effective target, so that they are not skipped by default.
- For example, tests for C++17 features should use
-</p><pre class="programlisting"> // { dg-options "-std=gnu++17" }</pre><p>
+ For example, tests for C++20 features should use
+</p><pre class="programlisting"> // { dg-options "-std=gnu++20" }</pre><p>
before any <code class="literal">dg-do</code> such as:
-</p><pre class="programlisting"> // { dg-do run "c++17" }</pre><p>
+</p><pre class="programlisting"> // { dg-do run { target c++20 } }</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.
+ before checking the <code class="literal">c++20</code> effective 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>
Example 1: Testing compilation only:
</p><pre class="programlisting">
be run for a specific standard (and not later standards) using an
effective target like <literal>c++11_only</literal>. However, this means
the test will be skipped by default (because the default mode is
- <literal>gnu++14</literal>), and so will only run when
+ <literal>gnu++17</literal>), and so will only run when
<option>-std=gnu++11</option> or <option>-std=c++11</option> is used
explicitly. For tests that require a specific standard it is better to
use a <literal>dg-options</literal> directive:
Similarly, tests which depend on a newer standard than the default
must use <literal>dg-options</literal> instead of (or in addition to)
an effective target, so that they are not skipped by default.
- For example, tests for C++17 features should use
-<programlisting> // { dg-options "-std=gnu++17" }</programlisting>
+ For example, tests for C++20 features should use
+<programlisting> // { dg-options "-std=gnu++20" }</programlisting>
before any <literal>dg-do</literal> such as:
-<programlisting> // { dg-do run "c++17" }</programlisting>
+<programlisting> // { dg-do run { target c++20 } }</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.
+ before checking the <literal>c++20</literal> effective target.
</para>
<section xml:id="tests.dg.examples"><info><title>Examples of Test Directives</title></info>