From: Jonathan Wakely Date: Fri, 8 Sep 2023 15:28:06 +0000 (+0100) Subject: libstdc++: Update outdated default -std in testing docs X-Git-Tag: releases/gcc-12.4.0~333 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8364faf223e54c0ddf7ab35eda158533e5195bb6;p=thirdparty%2Fgcc.git libstdc++: Update outdated default -std in testing docs libstdc++-v3/ChangeLog: * doc/xml/manual/test.xml: Update reference to -std=gnu++14 as the default. * doc/html/manual/test.html: Regenerate. (cherry picked from commit d8e351d8d656720f4037e0a86a4a6c73629e5307) --- diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html index ef56a3056873..168e247c52f0 100644 --- a/libstdc++-v3/doc/html/manual/test.html +++ b/libstdc++-v3/doc/html/manual/test.html @@ -452,7 +452,7 @@ cat 27_io/objects/char/3_xin.in | a.out
c++11_only. However, this means the test will be skipped by default (because the default mode is - gnu++14), and so will only run when + gnu++17), and so will only run when -std=gnu++11 or -std=c++11 is used explicitly. For tests that require a specific standard it is better to use a dg-options directive: @@ -466,13 +466,13 @@ cat 27_io/objects/char/3_xin.in | a.out
dg-options 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 -

    // { dg-options "-std=gnu++17" }

+ For example, tests for C++20 features should use +

    // { dg-options "-std=gnu++20" }

before any dg-do such as: -

    // { dg-do run "c++17" }

+

    // { dg-do run { target c++20 } }

The dg-options directive must come first, so that the -std flag has already been added to the options - before checking the c++17 target. + before checking the c++20 effective target.

Examples of Test Directives

Example 1: Testing compilation only:

diff --git a/libstdc++-v3/doc/xml/manual/test.xml b/libstdc++-v3/doc/xml/manual/test.xml
index ee00b06e3854..176661148100 100644
--- a/libstdc++-v3/doc/xml/manual/test.xml
+++ b/libstdc++-v3/doc/xml/manual/test.xml
@@ -749,7 +749,7 @@ cat 27_io/objects/char/3_xin.in | a.out
     be run for a specific standard (and not later standards) using an
     effective target like c++11_only. However, this means
     the test will be skipped by default (because the default mode is
-    gnu++14), and so will only run when
+    gnu++17), and so will only run when
      or  is used
     explicitly. For tests that require a specific standard it is better to
     use a dg-options directive:
@@ -765,13 +765,13 @@ cat 27_io/objects/char/3_xin.in | a.out
     Similarly, tests which depend on a newer standard than the default
     must use dg-options 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
-    // { dg-options "-std=gnu++17" }
+    For example, tests for C++20 features should use
+    // { dg-options "-std=gnu++20" }
     before any dg-do such as:
-    // { dg-do run "c++17" }
+    // { dg-do run { target c++20 } }
     The dg-options directive must come first, so that
     the -std flag has already been added to the options
-    before checking the c++17 target.
+    before checking the c++20 effective target.
   
 
 
Examples of Test Directives