[C++] (temporarily) undefine __cpp_consteval

Message ID 20191129093013.GI10088@tucnak
State New
Headers show
Series
  • [C++] (temporarily) undefine __cpp_consteval
Related show

Commit Message

Jakub Jelinek Nov. 29, 2019, 9:30 a.m.
Hi!

When submitting the P1902R1 patch for missing feature macros, I
completely forgot that we can't claim consteval support, because we have
the
  /* FIXME: For now.  */
  if (virtualp && (inlinep & 8) != 0)
    {
      sorry_at (DECL_SOURCE_LOCATION (decl),
                "%<virtual%> %<consteval%> method %qD not supported yet",
                decl);
      inlinep &= ~8;
    }
limitation in consteval support.  I've tried to make some progress on it
in PR88335, but am stuck, so this patch instead comments out this and
updates cxx-status.html to explain the partial support.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk and
wwwdocs?

2019-11-29  Jakub Jelinek  <jakub@redhat.com>

	* c-cppbuiltin.c (c_cpp_builtins): Don't define __cpp_consteval for
	now.

	* g++.dg/cpp2a/feat-cxx2a.C: Don't test __cpp_consteval for now.


	Jakub
diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
index c6ff78e1..c8655a17 100644
--- a/htdocs/projects/cxx-status.html
+++ b/htdocs/projects/cxx-status.html
@@ -288,7 +288,8 @@
     <tr>
       <td> Immediate functions (consteval) </td>
       <td><a href="http://wg21.link/p1073r3">P1073R3</a></td>
-      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a> </td>
+      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a>
+        (partial, no <code>consteval virtual</code> support) </td>
       <td> __cpp_consteval &gt;= 201811 </td>
     </tr>
     <tr>

Comments

Marek Polacek Nov. 29, 2019, 2:42 p.m. | #1
On Fri, Nov 29, 2019 at 10:30:13AM +0100, Jakub Jelinek wrote:
> --- a/htdocs/projects/cxx-status.html

> +++ b/htdocs/projects/cxx-status.html

> @@ -288,7 +288,8 @@

>      <tr>

>        <td> Immediate functions (consteval) </td>

>        <td><a href="http://wg21.link/p1073r3">P1073R3</a></td>

> -      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a> </td>

> +      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a>

> +        (partial, no <code>consteval virtual</code> support) </td>

>        <td> __cpp_consteval &gt;= 201811 </td>


You can use class="partial" which I added for use in the DR table.

--
Marek Polacek • Red Hat, Inc. • 300 A St, Boston, MA
Jakub Jelinek Nov. 29, 2019, 2:49 p.m. | #2
On Fri, Nov 29, 2019 at 09:42:06AM -0500, Marek Polacek wrote:
> On Fri, Nov 29, 2019 at 10:30:13AM +0100, Jakub Jelinek wrote:

> > --- a/htdocs/projects/cxx-status.html

> > +++ b/htdocs/projects/cxx-status.html

> > @@ -288,7 +288,8 @@

> >      <tr>

> >        <td> Immediate functions (consteval) </td>

> >        <td><a href="http://wg21.link/p1073r3">P1073R3</a></td>

> > -      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a> </td>

> > +      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a>

> > +        (partial, no <code>consteval virtual</code> support) </td>

> >        <td> __cpp_consteval &gt;= 201811 </td>

> 

> You can use class="partial" which I added for use in the DR table.


We have other partial ones (__VA_OPT__), so then:

diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
index c6ff78e1..00ca61e4 100644
--- a/htdocs/projects/cxx-status.html
+++ b/htdocs/projects/cxx-status.html
@@ -87,7 +87,7 @@
       <td> <code>__VA_OPT__</code> for preprocessor comma elision </td>
       <td><a href="http://wg21.link/p0306r4">P0306R4</a><br/>
       <a href="http://wg21.link/p1042r1">P1042R1</a></td>
-      <td class="supported"> <a href="../gcc-8/changes.html#cxx">8</a>
+      <td class="partial"> <a href="../gcc-8/changes.html#cxx">8</a>
         (partial, no <code>#__VA_OPT__</code> support) </td>
       <td> </td>
     </tr>
@@ -288,7 +288,8 @@
     <tr>
       <td> Immediate functions (consteval) </td>
       <td><a href="http://wg21.link/p1073r3">P1073R3</a></td>
-      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a> </td>
+      <td class="partial"> <a href="../gcc-10/changes.html#cxx">10</a>
+        (partial, no <code>consteval virtual</code> support) </td>
       <td> __cpp_consteval &gt;= 201811 </td>
     </tr>
     <tr>


	Jakub
Marek Polacek Nov. 29, 2019, 2:57 p.m. | #3
On Fri, Nov 29, 2019 at 03:49:37PM +0100, Jakub Jelinek wrote:
> On Fri, Nov 29, 2019 at 09:42:06AM -0500, Marek Polacek wrote:

> > On Fri, Nov 29, 2019 at 10:30:13AM +0100, Jakub Jelinek wrote:

> > > --- a/htdocs/projects/cxx-status.html

> > > +++ b/htdocs/projects/cxx-status.html

> > > @@ -288,7 +288,8 @@

> > >      <tr>

> > >        <td> Immediate functions (consteval) </td>

> > >        <td><a href="http://wg21.link/p1073r3">P1073R3</a></td>

> > > -      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a> </td>

> > > +      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a>

> > > +        (partial, no <code>consteval virtual</code> support) </td>

> > >        <td> __cpp_consteval &gt;= 201811 </td>

> > 

> > You can use class="partial" which I added for use in the DR table.

> 

> We have other partial ones (__VA_OPT__), so then:

> 

> diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html

> index c6ff78e1..00ca61e4 100644

> --- a/htdocs/projects/cxx-status.html

> +++ b/htdocs/projects/cxx-status.html

> @@ -87,7 +87,7 @@

>        <td> <code>__VA_OPT__</code> for preprocessor comma elision </td>

>        <td><a href="http://wg21.link/p0306r4">P0306R4</a><br/>

>        <a href="http://wg21.link/p1042r1">P1042R1</a></td>

> -      <td class="supported"> <a href="../gcc-8/changes.html#cxx">8</a>

> +      <td class="partial"> <a href="../gcc-8/changes.html#cxx">8</a>

>          (partial, no <code>#__VA_OPT__</code> support) </td>

>        <td> </td>

>      </tr>

> @@ -288,7 +288,8 @@

>      <tr>

>        <td> Immediate functions (consteval) </td>

>        <td><a href="http://wg21.link/p1073r3">P1073R3</a></td>

> -      <td class="supported"> <a href="../gcc-10/changes.html#cxx">10</a> </td>

> +      <td class="partial"> <a href="../gcc-10/changes.html#cxx">10</a>

> +        (partial, no <code>consteval virtual</code> support) </td>

>        <td> __cpp_consteval &gt;= 201811 </td>

>      </tr>

>      <tr>


Sure, this is fine.

Marek
Jakub Jelinek Dec. 6, 2019, 5:14 p.m. | #4
On Fri, Nov 29, 2019 at 10:30:13AM +0100, Jakub Jelinek wrote:
> 2019-11-29  Jakub Jelinek  <jakub@redhat.com>

> 

> 	* c-cppbuiltin.c (c_cpp_builtins): Don't define __cpp_consteval for

> 	now.

> 

> 	* g++.dg/cpp2a/feat-cxx2a.C: Don't test __cpp_consteval for now.


I'd like to ping this patch (the wwwdocs change has been committed already).
Thanks.

> --- gcc/c-family/c-cppbuiltin.c.jj	2019-11-28 09:02:23.705869433 +0100

> +++ gcc/c-family/c-cppbuiltin.c	2019-11-28 18:59:20.407918255 +0100

> @@ -999,7 +999,7 @@ c_cpp_builtins (cpp_reader *pfile)

>  	  cpp_define (pfile, "__cpp_designated_initializers=201707L");

>  	  cpp_define (pfile, "__cpp_constexpr_in_decltype=201711L");

>  	  cpp_define (pfile, "__cpp_conditional_explicit=201806L");

> -	  cpp_define (pfile, "__cpp_consteval=201811L");

> +	  /* cpp_define (pfile, "__cpp_consteval=201811L"); */

>  	  cpp_define (pfile, "__cpp_constinit=201907L");

>  	  cpp_define (pfile, "__cpp_deduction_guides=201907L");

>  	  cpp_define (pfile, "__cpp_nontype_template_parameter_class=201806L");

> --- gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C.jj	2019-11-28 09:02:25.331844453 +0100

> +++ gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C	2019-11-28 19:00:59.459400136 +0100

> @@ -520,11 +520,13 @@

>  #  error "__cpp_constexpr_in_decltype != 201711"

>  #endif

>  

> +/* Not supported fully yet:

>  #ifndef __cpp_consteval

>  #  error "__cpp_consteval"

>  #elif __cpp_consteval != 201811

>  #  error "__cpp_consteval != 201811"

>  #endif

> +*/

>  

>  #ifndef __cpp_concepts

>  #  error "__cpp_concepts"

> 


	Jakub
Jason Merrill Dec. 6, 2019, 9:08 p.m. | #5
On 11/29/19 4:30 AM, Jakub Jelinek wrote:
> Hi!

> 

> When submitting the P1902R1 patch for missing feature macros, I

> completely forgot that we can't claim consteval support, because we have

> the

>    /* FIXME: For now.  */

>    if (virtualp && (inlinep & 8) != 0)

>      {

>        sorry_at (DECL_SOURCE_LOCATION (decl),

>                  "%<virtual%> %<consteval%> method %qD not supported yet",

>                  decl);

>        inlinep &= ~8;

>      }

> limitation in consteval support.  I've tried to make some progress on it

> in PR88335, but am stuck, so this patch instead comments out this and

> updates cxx-status.html to explain the partial support.

> 

> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk and

> wwwdocs?


OK.

> 2019-11-29  Jakub Jelinek  <jakub@redhat.com>

> 

> 	* c-cppbuiltin.c (c_cpp_builtins): Don't define __cpp_consteval for

> 	now.

> 

> 	* g++.dg/cpp2a/feat-cxx2a.C: Don't test __cpp_consteval for now.

> 

> --- gcc/c-family/c-cppbuiltin.c.jj	2019-11-28 09:02:23.705869433 +0100

> +++ gcc/c-family/c-cppbuiltin.c	2019-11-28 18:59:20.407918255 +0100

> @@ -999,7 +999,7 @@ c_cpp_builtins (cpp_reader *pfile)

>   	  cpp_define (pfile, "__cpp_designated_initializers=201707L");

>   	  cpp_define (pfile, "__cpp_constexpr_in_decltype=201711L");

>   	  cpp_define (pfile, "__cpp_conditional_explicit=201806L");

> -	  cpp_define (pfile, "__cpp_consteval=201811L");

> +	  /* cpp_define (pfile, "__cpp_consteval=201811L"); */

>   	  cpp_define (pfile, "__cpp_constinit=201907L");

>   	  cpp_define (pfile, "__cpp_deduction_guides=201907L");

>   	  cpp_define (pfile, "__cpp_nontype_template_parameter_class=201806L");

> --- gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C.jj	2019-11-28 09:02:25.331844453 +0100

> +++ gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C	2019-11-28 19:00:59.459400136 +0100

> @@ -520,11 +520,13 @@

>   #  error "__cpp_constexpr_in_decltype != 201711"

>   #endif

>   

> +/* Not supported fully yet:

>   #ifndef __cpp_consteval

>   #  error "__cpp_consteval"

>   #elif __cpp_consteval != 201811

>   #  error "__cpp_consteval != 201811"

>   #endif

> +*/

>   

>   #ifndef __cpp_concepts

>   #  error "__cpp_concepts"

> 

> 	Jakub

>

Patch

--- gcc/c-family/c-cppbuiltin.c.jj	2019-11-28 09:02:23.705869433 +0100
+++ gcc/c-family/c-cppbuiltin.c	2019-11-28 18:59:20.407918255 +0100
@@ -999,7 +999,7 @@  c_cpp_builtins (cpp_reader *pfile)
 	  cpp_define (pfile, "__cpp_designated_initializers=201707L");
 	  cpp_define (pfile, "__cpp_constexpr_in_decltype=201711L");
 	  cpp_define (pfile, "__cpp_conditional_explicit=201806L");
-	  cpp_define (pfile, "__cpp_consteval=201811L");
+	  /* cpp_define (pfile, "__cpp_consteval=201811L"); */
 	  cpp_define (pfile, "__cpp_constinit=201907L");
 	  cpp_define (pfile, "__cpp_deduction_guides=201907L");
 	  cpp_define (pfile, "__cpp_nontype_template_parameter_class=201806L");
--- gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C.jj	2019-11-28 09:02:25.331844453 +0100
+++ gcc/testsuite/g++.dg/cpp2a/feat-cxx2a.C	2019-11-28 19:00:59.459400136 +0100
@@ -520,11 +520,13 @@ 
 #  error "__cpp_constexpr_in_decltype != 201711"
 #endif
 
+/* Not supported fully yet:
 #ifndef __cpp_consteval
 #  error "__cpp_consteval"
 #elif __cpp_consteval != 201811
 #  error "__cpp_consteval != 201811"
 #endif
+*/
 
 #ifndef __cpp_concepts
 #  error "__cpp_concepts"