This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ PATCH] Add a testcase for -std=c++1z


OK.

On Mon, Sep 18, 2017 at 2:48 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> On Fri, Sep 15, 2017 at 12:08:07PM -0400, Nathan Sidwell wrote:
>> On 09/14/2017 04:26 PM, Jakub Jelinek wrote:
>> > Hi!
>> >
>> > Given https://herbsutter.com/2017/09/06/c17-is-formally-approved/
>> > this patch makes -std=c++17 and -std=gnu++17 the documented options
>> > and -std=c++1z and -std=gnu++1z deprecated aliases, adjusts diagnostics etc.
>> >
>> > Bootstrapped/regtest on x86_64-linux and i686-linux, ok for trunk?
>> > The changes in gcc/testsuite/ and libstdc++/testsuite appart from
>> > *.exp files are just sed -i -e 's/1z/17/g' `find . -type f`.
>>
>> I think the patch is good, modulo the issue Pedro pointed at.
>
> After the patch we have no testcases testing c++1z anymore, this patch adds
> one.  And tests that __cplusplus is equal to the value we want.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2017-09-18  Jakub Jelinek  <jakub@redhat.com>
>
>         * g++.dg/cpp1z/cplusplus.C: Test that __cplusplus is equal to 201703L.
>         * g++.dg/cpp1z/cplusplus_1z.C: New test.
>
> --- gcc/testsuite/g++.dg/cpp1z/cplusplus.C.jj   2017-09-15 18:11:04.000000000 +0200
> +++ gcc/testsuite/g++.dg/cpp1z/cplusplus.C      2017-09-18 09:45:55.099541786 +0200
> @@ -1,6 +1,6 @@
>  // { dg-do compile }
>  // { dg-options "-std=c++17" }
>
> -#if __cplusplus <= 201402L
> -#error "__cplusplus <= 201402L"
> +#if __cplusplus != 201703L
> +#error "__cplusplus != 201703L"
>  #endif
> --- gcc/testsuite/g++.dg/cpp1z/cplusplus_1z.C.jj        2017-09-18 09:46:19.351239666 +0200
> +++ gcc/testsuite/g++.dg/cpp1z/cplusplus_1z.C   2017-09-18 09:46:26.730147741 +0200
> @@ -0,0 +1,6 @@
> +// { dg-do compile }
> +// { dg-options "-std=c++1z" }
> +
> +#if __cplusplus != 201703L
> +#error "__cplusplus != 201703L"
> +#endif
>
>
>         Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]