* [pushed] c++: P2493 feature test macro updates
@ 2022-02-09 14:40 Jason Merrill
2022-02-09 15:02 ` Jonathan Wakely
2022-02-09 15:24 ` Jakub Jelinek
0 siblings, 2 replies; 6+ messages in thread
From: Jason Merrill @ 2022-02-09 14:40 UTC (permalink / raw)
To: gcc-patches; +Cc: jwakely
The C++ committee just updated the values of these macros to reflect some
late C++20 papers that we implement but others don't yet; see PR103891.
Tested x86_64-pc-linux-gnu, applying to trunk.
gcc/c-family/ChangeLog:
* c-cppbuiltin.cc (c_cpp_builtins): Update values
of __cpp_constexpr and __cpp_concepts for C++20.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/feat-cxx2b.C: Adjust.
* g++.dg/cpp2a/feat-cxx2a.C: Adjust.
---
gcc/c-family/c-cppbuiltin.cc | 4 ++--
gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C | 4 ++--
gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C | 8 ++++----
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
index 528211cf50e..4672ae8486a 100644
--- a/gcc/c-family/c-cppbuiltin.cc
+++ b/gcc/c-family/c-cppbuiltin.cc
@@ -1059,7 +1059,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_generic_lambdas=201707L");
cpp_define (pfile, "__cpp_designated_initializers=201707L");
if (cxx_dialect <= cxx20)
- cpp_define (pfile, "__cpp_constexpr=201907L");
+ cpp_define (pfile, "__cpp_constexpr=202002L");
cpp_define (pfile, "__cpp_constexpr_in_decltype=201711L");
cpp_define (pfile, "__cpp_conditional_explicit=201806L");
cpp_define (pfile, "__cpp_consteval=201811L");
@@ -1084,7 +1084,7 @@ c_cpp_builtins (cpp_reader *pfile)
if (flag_concepts)
{
if (cxx_dialect >= cxx20)
- cpp_define (pfile, "__cpp_concepts=201907L");
+ cpp_define (pfile, "__cpp_concepts=202002L");
else
cpp_define (pfile, "__cpp_concepts=201507L");
}
diff --git a/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C b/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C
index 923e6bcf65e..c1f91e78e66 100644
--- a/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C
+++ b/gcc/testsuite/g++.dg/cpp23/feat-cxx2b.C
@@ -528,8 +528,8 @@
#ifndef __cpp_concepts
# error "__cpp_concepts"
-#elif __cpp_concepts != 201907
-# error "__cpp_concepts != 201907"
+#elif __cpp_concepts != 202002
+# error "__cpp_concepts != 202002"
#endif
#ifndef __cpp_using_enum
diff --git a/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C b/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
index 3239df824fc..c65ea6bf48a 100644
--- a/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
+++ b/gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C
@@ -134,8 +134,8 @@
#ifndef __cpp_constexpr
# error "__cpp_constexpr"
-#elif __cpp_constexpr != 201907
-# error "__cpp_constexpr != 201907"
+#elif __cpp_constexpr != 202002
+# error "__cpp_constexpr != 202002"
#endif
#ifndef __cpp_decltype_auto
@@ -528,8 +528,8 @@
#ifndef __cpp_concepts
# error "__cpp_concepts"
-#elif __cpp_concepts != 201907
-# error "__cpp_concepts != 201907"
+#elif __cpp_concepts != 202002
+# error "__cpp_concepts != 202002"
#endif
#ifndef __cpp_using_enum
base-commit: 59b31f0e2d187ebdb3d399661e22b28e4ebd8099
--
2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pushed] c++: P2493 feature test macro updates
2022-02-09 14:40 [pushed] c++: P2493 feature test macro updates Jason Merrill
@ 2022-02-09 15:02 ` Jonathan Wakely
2022-02-09 15:24 ` Jakub Jelinek
1 sibling, 0 replies; 6+ messages in thread
From: Jonathan Wakely @ 2022-02-09 15:02 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc Patches
On Wed, 9 Feb 2022 at 14:40, Jason Merrill wrote:
>
> The C++ committee just updated the values of these macros to reflect some
> late C++20 papers that we implement but others don't yet; see PR103891.
>
> Tested x86_64-pc-linux-gnu, applying to trunk.
Nice! I'll test the corresponding libstdc++ patch, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pushed] c++: P2493 feature test macro updates
2022-02-09 14:40 [pushed] c++: P2493 feature test macro updates Jason Merrill
2022-02-09 15:02 ` Jonathan Wakely
@ 2022-02-09 15:24 ` Jakub Jelinek
2022-02-09 15:38 ` Jonathan Wakely
1 sibling, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2022-02-09 15:24 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches, jwakely
On Wed, Feb 09, 2022 at 09:40:49AM -0500, Jason Merrill via Gcc-patches wrote:
> The C++ committee just updated the values of these macros to reflect some
> late C++20 papers that we implement but others don't yet; see PR103891.
>
> Tested x86_64-pc-linux-gnu, applying to trunk.
So, shouldn't we update project/cxx-status.html for that change?
Like following?
diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
index 014fed8b..4bbff256 100644
--- a/htdocs/projects/cxx-status.html
+++ b/htdocs/projects/cxx-status.html
@@ -312,7 +312,7 @@
<td rowspan=12> Concepts </td>
<td><a href="https://wg21.link/p0734r0">P0734R0</a></td>
<td class="supported" rowspan=11> <a href="../gcc-10/changes.html#cxx">10</a> </td>
- <td rowspan=12> __cpp_concepts >= 201907 </td>
+ <td rowspan=12> __cpp_concepts >= 202002 </td>
</tr>
<tr>
<td><a href="https://wg21.link/p0857r0">P0857R0</a></td>
@@ -590,7 +590,7 @@
<tr>
<td><a href="https://wg21.link/p1330r0">P1330R0</a></td>
<td class="supported center"> <a href="../gcc-9/changes.html#cxx">9</a> </td>
- <td> </td>
+ <td> __cpp_constexpr >= 202002 </td>
</tr>
<tr>
<template><!-- preserve CSS nth-child ordering --></template>
Jakub
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pushed] c++: P2493 feature test macro updates
2022-02-09 15:24 ` Jakub Jelinek
@ 2022-02-09 15:38 ` Jonathan Wakely
2022-02-09 15:45 ` Jakub Jelinek
0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2022-02-09 15:38 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Jason Merrill, gcc Patches
On Wed, 9 Feb 2022 at 15:24, Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Wed, Feb 09, 2022 at 09:40:49AM -0500, Jason Merrill via Gcc-patches wrote:
> > The C++ committee just updated the values of these macros to reflect some
> > late C++20 papers that we implement but others don't yet; see PR103891.
> >
> > Tested x86_64-pc-linux-gnu, applying to trunk.
>
> So, shouldn't we update project/cxx-status.html for that change?
>
> Like following?
>
> diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
> index 014fed8b..4bbff256 100644
> --- a/htdocs/projects/cxx-status.html
> +++ b/htdocs/projects/cxx-status.html
> @@ -312,7 +312,7 @@
> <td rowspan=12> Concepts </td>
> <td><a href="https://wg21.link/p0734r0">P0734R0</a></td>
> <td class="supported" rowspan=11> <a href="../gcc-10/changes.html#cxx">10</a> </td>
> - <td rowspan=12> __cpp_concepts >= 201907 </td>
> + <td rowspan=12> __cpp_concepts >= 202002 </td>
I don't like this change. The value to check for P0734R0 support is
still 201907. If you want to also check for P0848R3 support, you can
use 202002. So I think it would be better to move the P0848R3 row out
of the rowspan group, and then put 202002 as the macro for that paper.
> </tr>
> <tr>
> <td><a href="https://wg21.link/p0857r0">P0857R0</a></td>
> @@ -590,7 +590,7 @@
> <tr>
> <td><a href="https://wg21.link/p1330r0">P1330R0</a></td>
> <td class="supported center"> <a href="../gcc-9/changes.html#cxx">9</a> </td>
> - <td> </td>
> + <td> __cpp_constexpr >= 202002 </td>
> </tr>
> <tr>
> <template><!-- preserve CSS nth-child ordering --></template>
This one looks fine.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pushed] c++: P2493 feature test macro updates
2022-02-09 15:38 ` Jonathan Wakely
@ 2022-02-09 15:45 ` Jakub Jelinek
2022-02-09 15:46 ` Jonathan Wakely
0 siblings, 1 reply; 6+ messages in thread
From: Jakub Jelinek @ 2022-02-09 15:45 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: Jason Merrill, gcc Patches
On Wed, Feb 09, 2022 at 03:38:32PM +0000, Jonathan Wakely wrote:
> On Wed, 9 Feb 2022 at 15:24, Jakub Jelinek <jakub@redhat.com> wrote:
> >
> > On Wed, Feb 09, 2022 at 09:40:49AM -0500, Jason Merrill via Gcc-patches wrote:
> > > The C++ committee just updated the values of these macros to reflect some
> > > late C++20 papers that we implement but others don't yet; see PR103891.
> > >
> > > Tested x86_64-pc-linux-gnu, applying to trunk.
> >
> > So, shouldn't we update project/cxx-status.html for that change?
> >
> > Like following?
> >
> > diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
> > index 014fed8b..4bbff256 100644
> > --- a/htdocs/projects/cxx-status.html
> > +++ b/htdocs/projects/cxx-status.html
> > @@ -312,7 +312,7 @@
> > <td rowspan=12> Concepts </td>
> > <td><a href="https://wg21.link/p0734r0">P0734R0</a></td>
> > <td class="supported" rowspan=11> <a href="../gcc-10/changes.html#cxx">10</a> </td>
> > - <td rowspan=12> __cpp_concepts >= 201907 </td>
> > + <td rowspan=12> __cpp_concepts >= 202002 </td>
>
> I don't like this change. The value to check for P0734R0 support is
> still 201907. If you want to also check for P0848R3 support, you can
> use 202002. So I think it would be better to move the P0848R3 row out
> of the rowspan group, and then put 202002 as the macro for that paper.
So perhaps like following then?
diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
index 014fed8b..5141629b 100644
--- a/htdocs/projects/cxx-status.html
+++ b/htdocs/projects/cxx-status.html
@@ -312,7 +312,7 @@
<td rowspan=12> Concepts </td>
<td><a href="https://wg21.link/p0734r0">P0734R0</a></td>
<td class="supported" rowspan=11> <a href="../gcc-10/changes.html#cxx">10</a> </td>
- <td rowspan=12> __cpp_concepts >= 201907 </td>
+ <td rowspan=4> __cpp_concepts >= 201907 </td>
</tr>
<tr>
<td><a href="https://wg21.link/p0857r0">P0857R0</a></td>
@@ -325,9 +325,11 @@
</tr>
<tr>
<td><a href="https://wg21.link/p0848r3">P0848R3</a></td>
+ <td> __cpp_concepts >= 202002 </td>
</tr>
<tr>
<td><a href="https://wg21.link/p1616r1">P1616R1</a></td>
+ <td rowspan=7> __cpp_concepts >= 201907 </td>
</tr>
<tr>
<td><a href="https://wg21.link/p1452r2">P1452R2</a></td>
@@ -590,7 +592,7 @@
<tr>
<td><a href="https://wg21.link/p1330r0">P1330R0</a></td>
<td class="supported center"> <a href="../gcc-9/changes.html#cxx">9</a> </td>
- <td> </td>
+ <td> __cpp_constexpr >= 202002 </td>
</tr>
<tr>
<template><!-- preserve CSS nth-child ordering --></template>
Jakub
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pushed] c++: P2493 feature test macro updates
2022-02-09 15:45 ` Jakub Jelinek
@ 2022-02-09 15:46 ` Jonathan Wakely
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Wakely @ 2022-02-09 15:46 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Jason Merrill, gcc Patches
On Wed, 9 Feb 2022 at 15:45, Jakub Jelinek <jakub@redhat.com> wrote:
>
> On Wed, Feb 09, 2022 at 03:38:32PM +0000, Jonathan Wakely wrote:
> > On Wed, 9 Feb 2022 at 15:24, Jakub Jelinek <jakub@redhat.com> wrote:
> > >
> > > On Wed, Feb 09, 2022 at 09:40:49AM -0500, Jason Merrill via Gcc-patches wrote:
> > > > The C++ committee just updated the values of these macros to reflect some
> > > > late C++20 papers that we implement but others don't yet; see PR103891.
> > > >
> > > > Tested x86_64-pc-linux-gnu, applying to trunk.
> > >
> > > So, shouldn't we update project/cxx-status.html for that change?
> > >
> > > Like following?
> > >
> > > diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
> > > index 014fed8b..4bbff256 100644
> > > --- a/htdocs/projects/cxx-status.html
> > > +++ b/htdocs/projects/cxx-status.html
> > > @@ -312,7 +312,7 @@
> > > <td rowspan=12> Concepts </td>
> > > <td><a href="https://wg21.link/p0734r0">P0734R0</a></td>
> > > <td class="supported" rowspan=11> <a href="../gcc-10/changes.html#cxx">10</a> </td>
> > > - <td rowspan=12> __cpp_concepts >= 201907 </td>
> > > + <td rowspan=12> __cpp_concepts >= 202002 </td>
> >
> > I don't like this change. The value to check for P0734R0 support is
> > still 201907. If you want to also check for P0848R3 support, you can
> > use 202002. So I think it would be better to move the P0848R3 row out
> > of the rowspan group, and then put 202002 as the macro for that paper.
>
> So perhaps like following then?
That looks good to me.
> diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
> index 014fed8b..5141629b 100644
> --- a/htdocs/projects/cxx-status.html
> +++ b/htdocs/projects/cxx-status.html
> @@ -312,7 +312,7 @@
> <td rowspan=12> Concepts </td>
> <td><a href="https://wg21.link/p0734r0">P0734R0</a></td>
> <td class="supported" rowspan=11> <a href="../gcc-10/changes.html#cxx">10</a> </td>
> - <td rowspan=12> __cpp_concepts >= 201907 </td>
> + <td rowspan=4> __cpp_concepts >= 201907 </td>
> </tr>
> <tr>
> <td><a href="https://wg21.link/p0857r0">P0857R0</a></td>
> @@ -325,9 +325,11 @@
> </tr>
> <tr>
> <td><a href="https://wg21.link/p0848r3">P0848R3</a></td>
> + <td> __cpp_concepts >= 202002 </td>
> </tr>
> <tr>
> <td><a href="https://wg21.link/p1616r1">P1616R1</a></td>
> + <td rowspan=7> __cpp_concepts >= 201907 </td>
> </tr>
> <tr>
> <td><a href="https://wg21.link/p1452r2">P1452R2</a></td>
> @@ -590,7 +592,7 @@
> <tr>
> <td><a href="https://wg21.link/p1330r0">P1330R0</a></td>
> <td class="supported center"> <a href="../gcc-9/changes.html#cxx">9</a> </td>
> - <td> </td>
> + <td> __cpp_constexpr >= 202002 </td>
> </tr>
> <tr>
> <template><!-- preserve CSS nth-child ordering --></template>
>
>
> Jakub
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-02-09 15:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 14:40 [pushed] c++: P2493 feature test macro updates Jason Merrill
2022-02-09 15:02 ` Jonathan Wakely
2022-02-09 15:24 ` Jakub Jelinek
2022-02-09 15:38 ` Jonathan Wakely
2022-02-09 15:45 ` Jakub Jelinek
2022-02-09 15:46 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).