This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Add a testcase for -std=c++1z
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Nathan Sidwell <nathan at acm dot org>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Sep 2017 20:48:26 +0200
- Subject: [C++ PATCH] Add a testcase for -std=c++1z
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 671B89D503
- References: <20170914202634.GO1701@tucnak> <e89180f6-cac8-4087-2390-ab23ff2015f9@acm.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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