C++ PATCH for decomp31.C test

Message ID 20181012013951.GM19003@redhat.com
State New
Headers show
Series
  • C++ PATCH for decomp31.C test
Related show

Commit Message

Marek Polacek Oct. 12, 2018, 1:39 a.m.
Running make check-c++ RUNTESTFLAGS=dg.exp=decomp31.C will yield
# of unsupported tests		3
because the test (as the only one in cpp1z/) uses
"dg-do compile { target c++17 }" which doesn't work (yet?).  This patch
makes it use explicit dg-options as in other tests, so now we get
# of expected passes		1

Tested on x86_64-linux, ok for trunk?

2018-10-11  Marek Polacek  <polacek@redhat.com>

	* g++.dg/cpp1z/decomp31.C: Use explicit dg-options.

Comments

Jakub Jelinek Oct. 12, 2018, 8:09 a.m. | #1
On Thu, Oct 11, 2018 at 09:39:51PM -0400, Marek Polacek wrote:
> Running make check-c++ RUNTESTFLAGS=dg.exp=decomp31.C will yield
> # of unsupported tests		3
> because the test (as the only one in cpp1z/) uses
> "dg-do compile { target c++17 }" which doesn't work (yet?).  This patch
> makes it use explicit dg-options as in other tests, so now we get
> # of expected passes		1
> 
> Tested on x86_64-linux, ok for trunk?

I wrote it that way so that it is tested not just with -std=c++17, but also
with -std=c++2a and -std=c++17 -fconcepts.

I wonder if we shouldn't finally make the default testing include C++17 in
addition to 98/11/14, or if we plan to do that, whether we are going through
tests with such dg-options -std=c++17 and convert them back to { target
c++17 } if appropriate.

> 2018-10-11  Marek Polacek  <polacek@redhat.com>
> 
> 	* g++.dg/cpp1z/decomp31.C: Use explicit dg-options.
> 
> --- gcc/testsuite/g++.dg/cpp1z/decomp31.C
> +++ gcc/testsuite/g++.dg/cpp1z/decomp31.C
> @@ -1,5 +1,6 @@
>  // PR c++/81888
> -// { dg-do compile { target c++17 } }
> +// { dg-do compile }
> +// { dg-options "-std=c++17" }
>  
>  struct S {
>    bool s = true;

	Jakub
Jason Merrill Oct. 12, 2018, 12:59 p.m. | #2
On Fri, Oct 12, 2018 at 4:10 AM Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Thu, Oct 11, 2018 at 09:39:51PM -0400, Marek Polacek wrote:
> > Running make check-c++ RUNTESTFLAGS=dg.exp=decomp31.C will yield
> > # of unsupported tests                3
> > because the test (as the only one in cpp1z/) uses
> > "dg-do compile { target c++17 }" which doesn't work (yet?).  This patch
> > makes it use explicit dg-options as in other tests, so now we get
> > # of expected passes          1
> >
> > Tested on x86_64-linux, ok for trunk?
>
> I wrote it that way so that it is tested not just with -std=c++17, but also
> with -std=c++2a and -std=c++17 -fconcepts.
>
> I wonder if we shouldn't finally make the default testing include C++17 in
> addition to 98/11/14

Probably, though that gets to be a lot; we might drop C++11 from the
defaults at the same time.

> or if we plan to do that, whether we are going through
> tests with such dg-options -std=c++17 and convert them back to { target
> c++17 } if appropriate.

Yes.

Jason
Marek Polacek Oct. 12, 2018, 3:10 p.m. | #3
On Fri, Oct 12, 2018 at 08:59:00AM -0400, Jason Merrill wrote:
> On Fri, Oct 12, 2018 at 4:10 AM Jakub Jelinek <jakub@redhat.com> wrote:
> >
> > On Thu, Oct 11, 2018 at 09:39:51PM -0400, Marek Polacek wrote:
> > > Running make check-c++ RUNTESTFLAGS=dg.exp=decomp31.C will yield
> > > # of unsupported tests                3
> > > because the test (as the only one in cpp1z/) uses
> > > "dg-do compile { target c++17 }" which doesn't work (yet?).  This patch
> > > makes it use explicit dg-options as in other tests, so now we get
> > > # of expected passes          1
> > >
> > > Tested on x86_64-linux, ok for trunk?
> >
> > I wrote it that way so that it is tested not just with -std=c++17, but also
> > with -std=c++2a and -std=c++17 -fconcepts.
> >
> > I wonder if we shouldn't finally make the default testing include C++17 in
> > addition to 98/11/14
> 
> Probably, though that gets to be a lot; we might drop C++11 from the
> defaults at the same time.

Ok, I can work on this.

> > or if we plan to do that, whether we are going through
> > tests with such dg-options -std=c++17 and convert them back to { target
> > c++17 } if appropriate.
> 
> Yes.

Meanwhile, do we want my patch?  Or does it not matter at this point?

Marek

Patch

--- gcc/testsuite/g++.dg/cpp1z/decomp31.C
+++ gcc/testsuite/g++.dg/cpp1z/decomp31.C
@@ -1,5 +1,6 @@ 
 // PR c++/81888
-// { dg-do compile { target c++17 } }
+// { dg-do compile }
+// { dg-options "-std=c++17" }
 
 struct S {
   bool s = true;