From mboxrd@z Thu Jan 1 00:00:00 1970
Return-Path: 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:
@@ -482,13 +482,13 @@ cat 27_io/objects/char/3_xin.in | a.outdg-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.
Example 1: Testing compilation only:
diff --git a/libstdc++-v3/doc/xml/manual/test.xml b/libstdc++-v3/doc/xml/manual/test.xml index 964c53d26322..9853a2848148 100644 --- a/libstdc++-v3/doc/xml/manual/test.xml +++ b/libstdc++-v3/doc/xml/manual/test.xml @@ -767,7 +767,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 likec++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 adg-options directive: @@ -783,13 +783,13 @@ cat 27_io/objects/char/3_xin.in | a.out Similarly, tests which depend on a newer standard than the default must usedg-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 anydg-do such as: -// { dg-do run "c++17" } +// { dg-do run { target c++20 } } Thedg-options directive must come first, so that the-std flag has already been added to the options - before checking thec++17 target. + before checking thec++20 effective target.Examples of Test Directives