PATCH to fix g++.dg/cpp0x/fallthrough2.C

Jakub Jelinek jakub@redhat.com
Thu Sep 29 13:26:00 GMT 2016


On Thu, Sep 29, 2016 at 03:13:57PM +0200, Marek Polacek wrote:
> This test failed with make check-c++1z because in C++1z we don't get the
> expected message.
> 
> Bootstrapped/regtested on x86_64-linux, applying to trunk.
> 
> 2016-09-29  Marek Polacek  <polacek@redhat.com>
> 
> 	* g++.dg/cpp0x/fallthrough2.C: Only expect the warning in C++11 and
> 	C++14.
> 
> diff --git gcc/testsuite/g++.dg/cpp0x/fallthrough2.C gcc/testsuite/g++.dg/cpp0x/fallthrough2.C
> index b6964e1..71c4a4f 100644
> --- gcc/testsuite/g++.dg/cpp0x/fallthrough2.C
> +++ gcc/testsuite/g++.dg/cpp0x/fallthrough2.C
> @@ -11,7 +11,7 @@ f (int i)
>      {
>      case 1:
>        bar (1);
> -      [[fallthrough]]; // { dg-warning ".fallthrough. is a C\\+\\+17 feature" }
> +      [[fallthrough]]; // { dg-warning ".fallthrough. is a C\\+\\+17 feature" "" { target { ! c++1z } }  }

Shouldn't that be { target c++14_down } instead?

	Jakub



More information about the Gcc-patches mailing list