Re: [PATCH] Fix g++.dg/cpp2a/lambda-this3.C (Re: PATCH to enable testing C++17 by default)

2018-10-23 Thread Jason Merrill
OK.
On Tue, Oct 23, 2018 at 4:52 AM Jakub Jelinek  wrote:
>
> On Wed, Oct 17, 2018 at 03:31:43PM -0400, Marek Polacek wrote:
> > As discussed in  
> > it
> > seems to be a high time we turned on testing C++17 by default.
> >
> > The only interesting part is at the very end, otherwise most of the changes 
> > is
> > just using { target c++17 } instead of explicit dg-options.  Removing
> > dg-options has the effect that DEFAULT_CXXFLAGS comes in play, so I've 
> > removed
> > a bunch of stray semicolons to fix -Wpedantic errors.
> >
> > I wonder if we also want to enable 2a, but the overhead could be too much.  
> > Or
> > use 2a instead of 17?
> >
> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> >
> > 2018-10-17  Marek Polacek  
> >
> >   * g++.dg/*.C: Use target c++17 instead of explicit dg-options.
> >   * lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
> >   the list of default stds to test.
>
> > diff --git gcc/testsuite/g++.dg/cpp2a/lambda-this3.C 
> > gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> > index 5e5c8b3d50f..d1738ea7d17 100644
> > --- gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> > +++ gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> > @@ -1,6 +1,6 @@
> >  // P0806R2
> > -// { dg-do compile }
> > -// { dg-options "-std=c++17" }
> > +// { dg-do compile { target c++17 } }
> > +// { dg-options "" }
> >
> >  struct X {
> >int x;
>
> This test now fails with -std=gnu++2a:
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C: In lambda function:
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:8:15: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:8:15: note: add explicit 
> 'this' or '*this' capture
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C: In lambda function:
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:16:15: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:16:15: note: add explicit 
> 'this' or '*this' capture
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:17:16: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:17:16: note: add explicit 
> 'this' or '*this' capture
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:18:13: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:18:13: note: add explicit 
> 'this' or '*this' capture
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 8)
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 16)
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 17)
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 18)
> PASS: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a (test for excess errors)
>
> The following patch fixes this, tested on x86_64-linux with
> make check-c++-all RUNTESTFLAGS=dg.exp=lambda-this3.C
> Ok for trunk?
>
> 2018-10-23  Jakub Jelinek  
>
> * g++.dg/cpp2a/lambda-this3.C: Limit dg-bogus directives to 
> c++17_down only.
> Add expected warnings and messages for c++2a.
>
> --- gcc/testsuite/g++.dg/cpp2a/lambda-this3.C.jj2018-10-22 
> 09:28:06.807650016 +0200
> +++ gcc/testsuite/g++.dg/cpp2a/lambda-this3.C   2018-10-23 10:48:13.992577673 
> +0200
> @@ -5,7 +5,9 @@
>  struct X {
>int x;
>void foo (int n) {
> -auto a1 = [=] { x = n; }; // { dg-bogus "implicit capture" }
> +auto a1 = [=] { x = n; }; // { dg-bogus "implicit capture" "" { target 
> c++17_down } }
> + // { dg-warning "implicit capture of 'this' via 
> '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
> + // { dg-message "add explicit 'this' or 
> '\\\*this' capture" "" { target c++2a } .-2 }
>  auto a2 = [=, this] { x = n; };
>  // { dg-warning "explicit by-copy capture" "" { target c++17_down } .-1 }
>  auto a3 = [=, *this]() mutable { x = n; };
> @@ -13,9 +15,15 @@ struct X {
>  auto a5 = [&, this] { x = n; };
>  auto a6 = [&, *this]() mutable { x = n; };
>
> -auto a7 = [=] { // { dg-bogus "implicit capture" }
> -  auto a = [=] { // { dg-bogus "implicit capture" }
> -auto a2 = [=] { x = n; }; // { dg-bogus "implicit capture" }
> +auto a7 = [=] { // { dg-bogus "implicit capture" "" { target c++17_down 
> } }
> +   // { dg-warning "implicit capture of 'this' via 
> '\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
> +   // { dg-message "add explicit 'this' or '\\\*this' 
> capture" "" { target c++2a } .-2 }
> +  auto a = [=] { // { dg-bogus "implicit capture" "" { target c++17_down 
> } }
> +// 

Re: [PATCH] Fix g++.dg/cpp2a/lambda-this3.C (Re: PATCH to enable testing C++17 by default)

2018-10-23 Thread Marek Polacek
On Tue, Oct 23, 2018 at 10:52:02AM +0200, Jakub Jelinek wrote:
> On Wed, Oct 17, 2018 at 03:31:43PM -0400, Marek Polacek wrote:
> > As discussed in  
> > it
> > seems to be a high time we turned on testing C++17 by default.
> > 
> > The only interesting part is at the very end, otherwise most of the changes 
> > is
> > just using { target c++17 } instead of explicit dg-options.  Removing
> > dg-options has the effect that DEFAULT_CXXFLAGS comes in play, so I've 
> > removed
> > a bunch of stray semicolons to fix -Wpedantic errors.
> > 
> > I wonder if we also want to enable 2a, but the overhead could be too much.  
> > Or
> > use 2a instead of 17?
> > 
> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> > 
> > 2018-10-17  Marek Polacek  
> > 
> > * g++.dg/*.C: Use target c++17 instead of explicit dg-options.
> > * lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
> > the list of default stds to test.
> 
> > diff --git gcc/testsuite/g++.dg/cpp2a/lambda-this3.C 
> > gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> > index 5e5c8b3d50f..d1738ea7d17 100644
> > --- gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> > +++ gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> > @@ -1,6 +1,6 @@
> >  // P0806R2
> > -// { dg-do compile }
> > -// { dg-options "-std=c++17" }
> > +// { dg-do compile { target c++17 } }
> > +// { dg-options "" }
> >  
> >  struct X {
> >int x;
> 
> This test now fails with -std=gnu++2a:
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C: In lambda function:
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:8:15: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:8:15: note: add explicit 
> 'this' or '*this' capture
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C: In lambda function:
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:16:15: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:16:15: note: add explicit 
> 'this' or '*this' capture
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:17:16: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:17:16: note: add explicit 
> 'this' or '*this' capture
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:18:13: warning: implicit 
> capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
> /.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:18:13: note: add explicit 
> 'this' or '*this' capture
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 8)
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 16)
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 17)
> FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, 
> line 18)
> PASS: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a (test for excess errors)
> 
> The following patch fixes this, tested on x86_64-linux with
> make check-c++-all RUNTESTFLAGS=dg.exp=lambda-this3.C
> Ok for trunk?

Oops, sorry, I thought I'd limited the test to c++17_only.  I don't know why
it wasn't part of the patch.

Marek


[PATCH] Fix g++.dg/cpp2a/lambda-this3.C (Re: PATCH to enable testing C++17 by default)

2018-10-23 Thread Jakub Jelinek
On Wed, Oct 17, 2018 at 03:31:43PM -0400, Marek Polacek wrote:
> As discussed in  it
> seems to be a high time we turned on testing C++17 by default.
> 
> The only interesting part is at the very end, otherwise most of the changes is
> just using { target c++17 } instead of explicit dg-options.  Removing
> dg-options has the effect that DEFAULT_CXXFLAGS comes in play, so I've removed
> a bunch of stray semicolons to fix -Wpedantic errors.
> 
> I wonder if we also want to enable 2a, but the overhead could be too much.  Or
> use 2a instead of 17?
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
> 
> 2018-10-17  Marek Polacek  
> 
>   * g++.dg/*.C: Use target c++17 instead of explicit dg-options.
>   * lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
>   the list of default stds to test.

> diff --git gcc/testsuite/g++.dg/cpp2a/lambda-this3.C 
> gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> index 5e5c8b3d50f..d1738ea7d17 100644
> --- gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> +++ gcc/testsuite/g++.dg/cpp2a/lambda-this3.C
> @@ -1,6 +1,6 @@
>  // P0806R2
> -// { dg-do compile }
> -// { dg-options "-std=c++17" }
> +// { dg-do compile { target c++17 } }
> +// { dg-options "" }
>  
>  struct X {
>int x;

This test now fails with -std=gnu++2a:
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C: In lambda function:
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:8:15: warning: implicit 
capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:8:15: note: add explicit 
'this' or '*this' capture
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C: In lambda function:
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:16:15: warning: implicit 
capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:16:15: note: add explicit 
'this' or '*this' capture
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:17:16: warning: implicit 
capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:17:16: note: add explicit 
'this' or '*this' capture
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:18:13: warning: implicit 
capture of 'this' via '[=]' is deprecated in C++20 [-Wdeprecated]
/.../gcc/gcc/testsuite/g++.dg/cpp2a/lambda-this3.C:18:13: note: add explicit 
'this' or '*this' capture
FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, line 
8)
FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, line 
16)
FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, line 
17)
FAIL: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a  (test for bogus messages, line 
18)
PASS: g++.dg/cpp2a/lambda-this3.C  -std=gnu++2a (test for excess errors)

The following patch fixes this, tested on x86_64-linux with
make check-c++-all RUNTESTFLAGS=dg.exp=lambda-this3.C
Ok for trunk?

2018-10-23  Jakub Jelinek  

* g++.dg/cpp2a/lambda-this3.C: Limit dg-bogus directives to c++17_down 
only.
Add expected warnings and messages for c++2a.

--- gcc/testsuite/g++.dg/cpp2a/lambda-this3.C.jj2018-10-22 
09:28:06.807650016 +0200
+++ gcc/testsuite/g++.dg/cpp2a/lambda-this3.C   2018-10-23 10:48:13.992577673 
+0200
@@ -5,7 +5,9 @@
 struct X {
   int x;
   void foo (int n) {
-auto a1 = [=] { x = n; }; // { dg-bogus "implicit capture" }
+auto a1 = [=] { x = n; }; // { dg-bogus "implicit capture" "" { target 
c++17_down } }
+ // { dg-warning "implicit capture of 'this' via 
'\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
+ // { dg-message "add explicit 'this' or 
'\\\*this' capture" "" { target c++2a } .-2 }
 auto a2 = [=, this] { x = n; };
 // { dg-warning "explicit by-copy capture" "" { target c++17_down } .-1 }
 auto a3 = [=, *this]() mutable { x = n; };
@@ -13,9 +15,15 @@ struct X {
 auto a5 = [&, this] { x = n; };
 auto a6 = [&, *this]() mutable { x = n; };
 
-auto a7 = [=] { // { dg-bogus "implicit capture" }
-  auto a = [=] { // { dg-bogus "implicit capture" }
-auto a2 = [=] { x = n; }; // { dg-bogus "implicit capture" }
+auto a7 = [=] { // { dg-bogus "implicit capture" "" { target c++17_down } }
+   // { dg-warning "implicit capture of 'this' via '\\\[=\\\]' 
is deprecated" "" { target c++2a } .-1 }
+   // { dg-message "add explicit 'this' or '\\\*this' capture" 
"" { target c++2a } .-2 }
+  auto a = [=] { // { dg-bogus "implicit capture" "" { target c++17_down } 
}
+// { dg-warning "implicit capture of 'this' via 
'\\\[=\\\]' is deprecated" "" { target c++2a } .-1 }
+// { dg-message "add explicit 'this' or '\\\*this' 
capture" "" { target c++2a } .-2 }
+auto a2 = [=] { x = n; }; // { dg-bogus "implicit capture" "" { 

Re: PATCH to enable testing C++17 by default

2018-10-20 Thread Marek Polacek
On Wed, Oct 17, 2018 at 03:19:42PM -0600, Jeff Law wrote:
> On 10/17/18 1:31 PM, Marek Polacek wrote:
> > As discussed in  
> > it
> > seems to be a high time we turned on testing C++17 by default.
> > 
> > The only interesting part is at the very end, otherwise most of the changes 
> > is
> > just using { target c++17 } instead of explicit dg-options.  Removing
> > dg-options has the effect that DEFAULT_CXXFLAGS comes in play, so I've 
> > removed
> > a bunch of stray semicolons to fix -Wpedantic errors.
> > 
> > I wonder if we also want to enable 2a, but the overhead could be too much.  
> > Or
> > use 2a instead of 17?
> > 
> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> > 
> > 2018-10-17  Marek Polacek  
> > 
> > * g++.dg/*.C: Use target c++17 instead of explicit dg-options.
> > * lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
> > the list of default stds to test.Given this follows Jason's 
> > recommendations from the thread, OK for the
> trunk.
> 
> I'll leave it up to Jason to decide when to add 2a and whether or not to
> drop something at that time.

Hearing no objections, I've now committed the patch.

Marek


Re: PATCH to enable testing C++17 by default

2018-10-19 Thread Mike Stump
On Oct 17, 2018, at 2:19 PM, Jeff Law  wrote:
>> 2018-10-17  Marek Polacek  
>> 
>>  * g++.dg/*.C: Use target c++17 instead of explicit dg-options.
>>  * lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
>>  the list of default stds to test.Given this follows Jason's 
>> recommendations from the thread, OK for the trunk.
> 
> I'll leave it up to Jason to decide when to add 2a and whether or not to
> drop something at that time.

Gosh, I was going to say the same thing.

Re: PATCH to enable testing C++17 by default

2018-10-17 Thread Jeff Law
On 10/17/18 1:31 PM, Marek Polacek wrote:
> As discussed in  it
> seems to be a high time we turned on testing C++17 by default.
> 
> The only interesting part is at the very end, otherwise most of the changes is
> just using { target c++17 } instead of explicit dg-options.  Removing
> dg-options has the effect that DEFAULT_CXXFLAGS comes in play, so I've removed
> a bunch of stray semicolons to fix -Wpedantic errors.
> 
> I wonder if we also want to enable 2a, but the overhead could be too much.  Or
> use 2a instead of 17?
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
> 
> 2018-10-17  Marek Polacek  
> 
>   * g++.dg/*.C: Use target c++17 instead of explicit dg-options.
>   * lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
>   the list of default stds to test.Given this follows Jason's 
> recommendations from the thread, OK for the
trunk.

I'll leave it up to Jason to decide when to add 2a and whether or not to
drop something at that time.

jeff


PATCH to enable testing C++17 by default

2018-10-17 Thread Marek Polacek
As discussed in  it
seems to be a high time we turned on testing C++17 by default.

The only interesting part is at the very end, otherwise most of the changes is
just using { target c++17 } instead of explicit dg-options.  Removing
dg-options has the effect that DEFAULT_CXXFLAGS comes in play, so I've removed
a bunch of stray semicolons to fix -Wpedantic errors.

I wonder if we also want to enable 2a, but the overhead could be too much.  Or
use 2a instead of 17?

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2018-10-17  Marek Polacek  

* g++.dg/*.C: Use target c++17 instead of explicit dg-options.
* lib/g++-dg.exp: Don't test C++11 by default.  Add C++17 to
the list of default stds to test.

diff --git gcc/testsuite/g++.dg/concepts/alias1.C 
gcc/testsuite/g++.dg/concepts/alias1.C
index 1b643cdd1c9..279a4787576 100644
--- gcc/testsuite/g++.dg/concepts/alias1.C
+++ gcc/testsuite/g++.dg/concepts/alias1.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template
   concept bool C() { return __is_class(T); }
diff --git gcc/testsuite/g++.dg/concepts/alias2.C 
gcc/testsuite/g++.dg/concepts/alias2.C
index 2de2aa4da94..06ffb1af529 100644
--- gcc/testsuite/g++.dg/concepts/alias2.C
+++ gcc/testsuite/g++.dg/concepts/alias2.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template
   concept bool C() { return __is_class(T); }
diff --git gcc/testsuite/g++.dg/concepts/alias3.C 
gcc/testsuite/g++.dg/concepts/alias3.C
index 6e1c39ce174..2901c041881 100644
--- gcc/testsuite/g++.dg/concepts/alias3.C
+++ gcc/testsuite/g++.dg/concepts/alias3.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template
   concept bool C() { return __is_class(T); }
diff --git gcc/testsuite/g++.dg/concepts/alias4.C 
gcc/testsuite/g++.dg/concepts/alias4.C
index e7d93d5875f..2c9f5defeb0 100644
--- gcc/testsuite/g++.dg/concepts/alias4.C
+++ gcc/testsuite/g++.dg/concepts/alias4.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template
   concept bool C() { return __is_class(T); }
diff --git gcc/testsuite/g++.dg/concepts/auto1.C 
gcc/testsuite/g++.dg/concepts/auto1.C
index 0c6fa465fa6..2682940cedd 100644
--- gcc/testsuite/g++.dg/concepts/auto1.C
+++ gcc/testsuite/g++.dg/concepts/auto1.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template  class A { };
 
diff --git gcc/testsuite/g++.dg/concepts/auto3.C 
gcc/testsuite/g++.dg/concepts/auto3.C
index 7b80fe314b8..abfb2019125 100644
--- gcc/testsuite/g++.dg/concepts/auto3.C
+++ gcc/testsuite/g++.dg/concepts/auto3.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template  class tuple {};
 
diff --git gcc/testsuite/g++.dg/concepts/auto4.C 
gcc/testsuite/g++.dg/concepts/auto4.C
index e80341ec038..4eb2ae8f7d5 100644
--- gcc/testsuite/g++.dg/concepts/auto4.C
+++ gcc/testsuite/g++.dg/concepts/auto4.C
@@ -1,5 +1,6 @@
 // PR c++/85006
-// { dg-additional-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-fconcepts" }
 
 template struct A {};
 
diff --git gcc/testsuite/g++.dg/concepts/class-deduction1.C 
gcc/testsuite/g++.dg/concepts/class-deduction1.C
index 476830d9252..936dd6826f0 100644
--- gcc/testsuite/g++.dg/concepts/class-deduction1.C
+++ gcc/testsuite/g++.dg/concepts/class-deduction1.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template 
 concept bool Isint = __is_same_as(T,int);
diff --git gcc/testsuite/g++.dg/concepts/class-deduction2.C 
gcc/testsuite/g++.dg/concepts/class-deduction2.C
index 286e59a5039..e0718d1d0cf 100644
--- gcc/testsuite/g++.dg/concepts/class-deduction2.C
+++ gcc/testsuite/g++.dg/concepts/class-deduction2.C
@@ -1,5 +1,6 @@
 // PR c++/85706
-// { dg-additional-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-additional-options "-fconcepts" }
 
 template struct S {
   S(T);
diff --git gcc/testsuite/g++.dg/concepts/class.C 
gcc/testsuite/g++.dg/concepts/class.C
index 1c5242f8089..dc5523e2407 100644
--- gcc/testsuite/g++.dg/concepts/class.C
+++ gcc/testsuite/g++.dg/concepts/class.C
@@ -1,4 +1,5 @@
-// { dg-options "-std=c++17 -fconcepts" }
+// { dg-do compile { target c++17 } }
+// { dg-options "-fconcepts" }
 
 template
   concept bool Class() { return __is_class(T); }
diff --git gcc/testsuite/g++.dg/concepts/class1.C 
gcc/testsuite/g++.dg/concepts/class1.C
index 94a5d23a873..a738e6e82cd 100644
---