On Wed, 15 Dec 2021, Jakub Jelinek wrote:

> On Mon, Dec 13, 2021 at 04:28:26PM -0500, Patrick Palka via Gcc-patches wrote:
> >     * g++.dg/concepts/diagnostic18.C: Expect a "constraints on a
> >     non-templated function" error.
> >     * g++.dg/cpp23/auto-fncast10.C: New test.
> 
> This test fails:
> +FAIL: g++.dg/cpp23/auto-fncast11.C  -std=c++2b  (test for errors, line 19)
> +FAIL: g++.dg/cpp23/auto-fncast11.C  -std=c++2b (test for excess errors)
> because the regex in dg-error was missing an indefinite article.
> 
> Tested with
> GXX_TESTSUITE_STDS=98,11,14,17,20,2b make check-g++ 
> RUNTESTFLAGS="dg.exp=auto-fncast11.C"
> and committed to trunk as obvious:

Oops, thanks Jakub, I didn't realize we don't run the testsuite with
-std=c++23 yet.

I guess it'd be too expensive to add another std to the testing matrix
at this point, but I wonder if the test harness should at least run the
testcases inside cpp23/ with -std=c++23?  Something like the following
seems to work.

(And since -std=c++11 also isn't part of the default testing matrix
anymore, perhaps we could give the testscases inside cpp0x/ a similar
treatment too?)

-- >8 --

Subject: [PATCH] testsuite: run testcases in g++.dg/cpp23/ with -std=c++23

gcc/testsuite/ChangeLog:

        * lib/g++-dg.exp (g++-dg-runtest): Add -std=c++23 to option_list
        for testcases in cpp23/.
---
 gcc/testsuite/lib/g++-dg.exp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/lib/g++-dg.exp b/gcc/testsuite/lib/g++-dg.exp
index fd06d278faa..79fe3db014e 100644
--- a/gcc/testsuite/lib/g++-dg.exp
+++ b/gcc/testsuite/lib/g++-dg.exp
@@ -38,6 +38,8 @@ proc g++-dg-runtest { testcases flags default-extra-flags } {
            continue
        }
 
+       set nshort [file tail [file dirname $test]]/[file tail $test]
+
        # If the testcase specifies a standard, use that one.
        # If not, run it under both standards, allowing GNU extensions
        # if there's a dg-options line.
@@ -61,12 +63,13 @@ proc g++-dg-runtest { testcases flags default-extra-flags } 
{
                } elseif { $x eq "impcx" } then { set x "23 
-fimplicit-constexpr" }
                lappend option_list "${std_prefix}$x"
            }
+           if [string match "cpp23/*" $nshort] {
+               lappend option_list "${std_prefix}23"
+           }
        } else {
            set option_list { "" }
        }
 
-       set nshort [file tail [file dirname $test]]/[file tail $test]
-
        foreach flags_t $option_list {
            verbose "Testing $nshort, $flags $flags_t" 1
            dg-test $test "$flags $flags_t" ${default-extra-flags}
-- 
2.34.1.182.ge773545c7f

Reply via email to